• Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding getParameter

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a button that has a name and id, and is mapped to a specific Servlet when pressed.

In my Servlet, i want to get that id or name, but it's not working with request.getParameter.

Can any one please tell me how can i do that ?

Thanks in advance ...
[ June 13, 2007: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vassili Vladimir:
... and is mapped to a specific Servlet when pressed. ...


Can you explain what you mean when you say "mapped to a specific servlet"?
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i mean that the button is inside a form that has an action attribute

Now who can answer my question ???

Thanks in advance ...
 
Srivatsa Katta
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please post your code.. your question is still not clear..

Regards,
Srivatsa Katta
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Here goes a code snippet :

 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it a submit button or a button with javascript?
See how we have to guess without source to look at?
 
Srivatsa Katta
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vassili,

Looking @ your code..

request.getParameter("someOtherValue"); should give you the value, where someOtherValue in the above statement is the dynamic value which is same as what it gets resolved in JSP.

If its returning null, try enumerating the request.getParameterNames() and see if the someOtherValue is there in the request map. If its there then you should as well get it in request.getParameter("someOtherValue");

Regards,
Srivatsa Katta
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vassili Vladimir:

<input type="submit" id="<%= someValue%>" name="<%= someOtherValue%>"/>


Your submit button has no value attribute.

BTW: The id attribute means nothing to your server side code.
It is only used by the client for identifying that particular element on a page.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have enumerated it and it worked

Thank you everybody

Best regards ...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!