wood burning stoves 2.0*
The moose likes Struts and the fly likes multiple forms in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "multiple forms in struts" Watch "multiple forms in struts" New topic

multiple forms in struts

vara prasad
Ranch Hand

Joined: Dec 21, 2004
Posts: 47
I am having the requirement as I have to take multiple fields from the user.
For that i Want to use multiple jsp pages with NEXT button , when i press NEXT button it has to display next jsp page,last jsp will have submit button. when i press SUBMIT button, then Action Form class will be involked there i have to perform validation for all the fields of all jsps.
How can I do it.
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
Use the same ActionForm class for each Action. Keep the ActionForm in session scope. Each view (JSP) will only expose and modify a portion of the ActionForm.
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
I wish add this too..
If you have any restriction in keeping the entire actionForm object in session, you have to use the hidden fields in each page and set those fileds in Action class when user navigate thru the pages.

Any other ideas?

Sarath Mohan
jQuery in Action, 2nd edition
subject: multiple forms in struts
Similar Threads
2 submit buttons with different action
How to Update multiple rows of a table in jsp
Sign in button
Struts 1.1 question (Might not be an easy one)