• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access a param from HttpRequest

 
Anil Rayarapu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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?
 
Chris Smith
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Phil Chuang
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic