Thanks for your reply.
Well I have created a formbean (fields of all
jsp) and configure my struts-config.xml file as:
code:
--------------------------------------------------------------------------------
<struts-config><form-beans><form-bean name="userRegistrationForm" type="multipleform.UserRegistrationForm"/></form-beans><action-mappings> <action path="/userRegistration" type="multipleform.UserRegistrationAction"name="userRegistrationForm"attribute="user"scope="session"input="/multipleform.jsp"><forward name="success" path="/multipleform1.jsp"/><forward name="failure" path="/userregfailure.jsp"/></action> <action path="/userRegistration1" type="multipleform.UserRegistrationAction"name="userRegistrationForm"attribute="user"scope="session"input="/multipleform1.jsp"><forward name="success" path="/userregsuccess.jsp"/><forward name="failure" path="/userregfailure.jsp"/></action></action-mappings></struts-config>
--------------------------------------------------------------------------------
multipleform.jsp is as:
code:
--------------------------------------------------------------------------------
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%><html><head><title>User Registration</title></head><body><h1>User Registration</h1><html:errors/><table><html:form action="/userRegistration.do" focus="firstName"><tr><td>First Name</td><td><html:text property="firstName"/></td></tr><td>Last Name</td><td><html:text property="lastName"/></td><tr><td>User Name</td><td><html:text property="userName"/></td></tr><tr><td>Email:</td><td><html:text property="email"/></td></tr><tr><td>Phone</td><td><html:text property="phone"/></td></tr><tr><td>Fax</td><td><html:text property="fax"/></td></tr><tr><td>Password</td><td><html assword property="password"/></td></tr><tr><td>Retype password</td><td><html assword property="passwordCheck"/><html:hidden property="page" value="2"/></td></tr><tr><td><html:submit/></td><td><html:cancel/></td></tr></html:form></table></body></html>
--------------------------------------------------------------------------------
multipleform1.jsp is as:
code:
--------------------------------------------------------------------------------
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%><html><head><title>User Registration</title></head><body><h1>User Registration</h1><html:errors/><table><html:form action="/userRegistration1.do"><tr><td>Ename:</td><td><html:text property="ename"/></td></tr><tr><td><html:submit/></td><td><html:cancel/></td></tr></html:form></table></body></html>
--------------------------------------------------------------------------------
UserRegistrationForm is as:
code:
--------------------------------------------------------------------------------
package multipleform; import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionMapping;import org.apache.struts.action.ActionErrors;import org.apache.struts.action.ActionError;import javax.servlet.http.HttpServletRequest; public class UserRegistrationForm extends ActionForm {private
String firstName;private String lastName;private String userName;private String password;private String passwordCheck;private String email;private String phone;private String fax;private String ename;private boolean registered; public UserRegistrationForm() {} public String getFirstName() {return this.firstName;}public void setFirstName(String firstName) {this.firstName = firstName;} public String getEmail() {return this.email;}public void setEmail(String email) {this.email = email;} public String getLastName() {return this.lastName;}public void setLastName(String lastName) {this.lastName = lastName;} public String getUserName() {return this.userName;}public void setUserName(String userName) {this.userName = userName;} public String getPassword() {return this.password;}public void setPassword(String password) {this.password = password;} public String getPasswordCheck() {return this.passwordCheck;}public void setPasswordCheck(String passwordCheck) {this.passwordCheck = passwordCheck;} public String getPhone() {return this.phone;}public void setPhone(String phone) {this.phone = phone;} public String getFax() {return this.fax;}public void setFax(String fax) {this.fax = fax;} public boolean getRegistered() {return this.registered;}public void setRegistered(boolean registered) {this.registered = registered;} public String getEname() {return this.ename;}public void setEname(String ename) {this.ename = ename;} public void reset(ActionMapping mapping,HttpServletRequest request) {firstName=null;lastName=null;userName=null;password=null;passwordCheck=null;email=null;phone=null;fax=null;registered=false;} private String[] defaultValues ={ firstName, lastName, userName, password,passwordCheck,email,phone,fax }; public boolean isMissing(String value) {if ((value == null) || (value.trim().equals(""))){return(true);} else {for(int i=0; i<defaultValues.length; i++) {if (value.equals(defaultValues[i])) {return(true);}}return(false);}} }
--------------------------------------------------------------------------------
The following is the url...
http://localhost/multipleform.jsp When I click on the Submit button of this form the following page opens
url is :
http://localhost/multipleform1.jsp And it gives me the following error:
says......
code:
--------------------------------------------------------------------------------
javax.servlet.jsp.JspException: No getter method for property ename of bean org.apache.struts.taglib.html.BEAN
--------------------------------------------------------------------------------
I don't know where I am going wrong well as I have created a form bean in which there are set and get methods of all jsps.
Answer Please...
Please reply soon.
Thanks in advance..