Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Form with only Submit Form Elements

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form and basically it is for verification of a DB lookup. So all it does is display some data from the DB. The only real form elements are the Continue and Cancel buttons. Am I still required to have an ActionForm/DynaActionForm for this form?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only if you want it to work. <Kidding/>
There's ways of getting around it. Javascript would be one.
I think the benefits of keeping navigation in struts-config outweigh the costs of an extra action and actionform, no matter how trivial they seem.
All you need is a getButton/setButton in the form and a
forward = mapping.findForward(myForm.getButton());
in the action.
Then just map your struts-config accordingly, with a "Continue" and "Cancel"
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic