This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi there, I'm trying to find some example on internet regarding have multiple forms related between eachother, something like a wizard, where the user submit his data first and than other details on a second page.
What I'm trying to figure out, is a way to pass the all data to my action class only when the last form has been validated. I found something regarding validation and an attribute called "page" and another artcle about nested tags.
You can use multiple forms in session scope. On each page you submit to the action that loads the next page and the data is saved in the session. After the final action, you can manually validate the contents of the forms.
If you want to aviod session scope, you can create 1 form (using request scope and used in all of the wizard actions) that is a superset of all of the forms that you would put in session using the above method. Then, on each sucessive page of the wizard, use hidden fields to retain all of the data that has already been entered.
I try not to put anything unnecessary in session, so I would use the second method.