Hi,
I'm new to Struts. I extract struts-crud.war file in TomCat's webapps
folder. Its work fine I changed jsp file to add a field but it shows error
msg.
First I add a field in emplkoyeeForm.jsp as follow
<s:textfield name="employee.city" value="%{employee.city}"
label="%{getText('label.city')}" size="40"/>
I added a line in classes/guest.property as follow
label.city=City
In struts-crud\WEB-INF\src\com\aurifa\struts2\tutorial\model\Employee.java
I decelared a String city and I created a getter and setter method. And also
created a new constructor
the changes as follow
private String city;
public Employee(Integer employeeId, String firstName, String lastName,
Integer age, Department department, String city) {
this.employeeId = employeeId;
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.department = department;
this.city = city;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
Then I run the strutes in my tomcat5.5
It shows the following errors.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
javax.servlet.ServletException: Filter execution threw an exception
root cause
java.lang.NoClassDefFoundError: Could not initialize class
com.aurifa.struts2.tutorial.action.EmployeeAction
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:121)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:152)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:141)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:111)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:270)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:360)
com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:78)
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
If you know please tel me...
Thanks.
--
View this message in context:
http://www.nabble.com/Having-problem-with-Struts-CRUD-tp20851894p20851894.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]