• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
A timing clock, fuse wire, high explosives and a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic