This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
My suggestion would be to create a single ActionForm with properties for all the fields needed by all pages of the registration process. Assign this same ActionForm to each of the pages and specify "session" as the scope. The user can then move back and forth between the pages with all values being retained. Then when the final page is submitted, all the data needed will be in the ActionForm and can be persisted.
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.
Please reply soon.
Thanks in advance..
Joined: Feb 15, 2005
<html:form action="/userRegistration.do" ...
When the error message lists org.apache.struts.taglib.html.BEAN as the bean, that means Struts is not finding the correct form bean. Since it's the action attribute in the <html:form> tag that associates the page with the correct form bean, it must match exactly the action path definied in the struts-config.xml file.
Joined: Dec 17, 2005
Thanks for your reply,
But that's not the problem as I have changed the setting as you describe but its giving me the same problem.
Now my change struts-config.xml file is as: ---------------------------- <form-beans> <form-bean name="userRegistrationForm" type="multipleform.UserRegistrationForm"/> </form-beans>
well I have changed the setting as you mentioned but now it gives me the following error. ----------- javax.servlet.jsp.JspException: Cannot retrieve mapping for action /userRegistration ------------ If I changed the setting mentioned by you.
Joined: Feb 15, 2005
I believe I finally see the problem:
Remove attribute="user" from both your userRegistration and userRegistration1 action mappings in the struts-config.xml file. This has the effect of nullifying the connection between the action and the userRegistrationForm bean.
Your two <html:form> tags should have attribute="/userRegistration1" and attribute="/userRegistration"
P.S. For future reference, when you post code, please put it in a more readable format with indentation and white space. Had this code not been in such an unreadable format, someone might have caught this sooner. [ January 25, 2006: Message edited by: Merrill Higginson ]