This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Multiple JSP pages with Single Action class & form beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiple JSP pages with Single Action class & form beans" Watch "Multiple JSP pages with Single Action class & form beans" New topic
Author

Multiple JSP pages with Single Action class & form beans

Bhaskar Reddy
Ranch Hand

Joined: Dec 17, 2002
Posts: 52
Hi Folks,

I need to implement a wizard-like functionality. Basically, it will contain 3 steps in separate JSP pages & the third page is where we need to submit the data that is entered in all three pages.
In each of these pages, there is 'previous' & 'next' button, which means I need to retain values in each of these pages if the user would like to 'go back' after a certain validation error in the current page.

I am planning to have a single form bean & single action class to implement the above functionality.

Listed below are my initial thoughts on how to go about implementing this. Experts in this forum, please help me if I have gone wrong in my thoughts...
1. I need to have three different action mapping entries (in struts-config.xml file) each for buttons in each of the pages?
2. I can use the same form & same action class for ALL the action mapping entries & keep the scope in 'session'?
3. In each of the three JSPs, I can have a <html:form> tag which maps to the same form?
4. How would be the validation in each specific form be possible?

If anyone has come across such scripts, appreciate if you can provide me the reference. Also, if you think this is a bit more tedious than creating 3 form beans / 3 action classes, please advise.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple JSP pages with Single Action class & form beans
 
Similar Threads
DispatchAction question
about struts
DynaValidatorForm and Wizards
Multipage Form implementation
declarative validation of wizard pages