• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

multiple actions for one html:form

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic