This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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.
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic