Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple forms in struts

 
vara prasad
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic