It's not a secret anymore!
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
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
I agree. Here's the link:
subject: multiple forms in struts
jQuery in Action, 3rd edition