• 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

Tracking a request in struts

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My index page has two links "checking" and "saving" and I want to use the same <action-mapping> in the struts-config.xml file since both do the same thing except for one thing, which is

in my jsp page I have a hidden field:
<input type="hidden" name="check_save" value="1">

when clicking on "checking" I want the value of "check_save" to be "1" and
when clicking on "saving" I want the value of "check_save" to be "2", since the query I do in my bean differes according to the value.

the question is since both links use the same action how do I track where the request is coming from "checking" or "saving" to change the value of "check_save" accordingly?
 
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
I recommend using two ActionMappings but have them both use the same Action. You can use the different ActionMappings to specify the parameter you desire. This can be done using the parameter attribute of the ActionMappings in struts-config.

Having two Actions really isn't that bad of an idea either.
 
Abebe Belew
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not quite sure what you suggested since I am new to struts.
can you please give me an example?
[ December 03, 2004: Message edited by: Abebe Belew ]
 
Abebe Belew
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does anybody have an example of how to use the property parameter in Action Mapping to solve the above mentioned question?
reply
    Bookmark Topic Watch Topic
  • New Topic