Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
Author

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
Sheriff

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: multiple forms in struts