• 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

access a param from HttpRequest

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I need some help in this one.
How can i access which button is pressed in a actionclass from the Httprequest passed to it?
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you assign a "name" and "value" attribute to a standard button, the request parameters will include a name/value pair containing that name and value. My preference, since the "value" attribute is also used by the user agent to render the screen, is to ignore it and give buttons unique names; then, check which one is present.
For image buttons, the name will be used, but ".x" and ".y" appended, along with the coordinates of the mouse click. Most of the time, you don't care about those, so just ignore them... but again, use the button's name attribute to identify it. That is, if your HTML says "<input name='test'>", just check the request parameters for a parameter with the name "test.x".
HTH
 
Anil Rayarapu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Smith.. I was looking where i can find the syntax for the code and the function for calling the value also.
 
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For reference:
http://java.sun.com/products/servlet/2.3/javadoc/index.html
Look around in there, you should find what you're looking for.
[ March 24, 2003: Message edited by: Phil Chuang ]
 
Something about .... going for a swim. With this 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