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

validation=false

 
Sanjay Virkar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do we have to create form bean even when you don't need it?

On my form I have only one button and no data entry field so no need for validation. Can I bypass creation of the ActionForm completely?
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. You do not have to create one if there is no need for it.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bosun's statement needs to be qualified a bit. While it's true you can have an Action without an ActionForm defined for it, you cannot specify such an action in an <html:form> tag. You can only call such an action as URL (e.g. myAction.do).

One option would be to use the plain HTML <form> tag specifying "myAction.do" as the action. If you still want to use the <html:form> tag but don't want to create an Action form, simply declare the DynaActionForm class as the Actionform.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic