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 actions for one html:form

 
David Cox
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to associate different actions to one <html:form>, depending which submitButton was clicked on.

For example five submit buttons in one <html:form> and each submit button activates a different Action.Anybody know a good solution?.
[ March 22, 2005: Message edited by: David Cox ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a common solution to put more than one execute-style method in a DispatchAction. The DispatchAction which will determine which execute-style method call. Now, it IS possible to make the buttons each go to a different Action entirely but you'd have to use Javascript >blech!< or some other crazy trick - so IMO it is much simpler to use a DispatchAction of some sort.

LookupDispatchAction and MappingDispatchAction both extend DispatchAction and come packaged with the Struts framework.

CommandDispatchAction is my rewrite of the DispatchAction and comes packaged with free technical support.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic