File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

parameter to servlet

 
yoop
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in which method shuld i use at the servlet code for request
the value of a radio button in the html code?
html::
<input type=radio name=x value=z>z
<input type=radio name=x value=y>y
java::
String a=request.someMethod("x");
 
Bosun Bello
Ranch Hand
Posts: 1510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put it in your doGet or doPost...it depends on your processing needs. String a=request.getParameter("x")

Bosun
 
yoop
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bosun Bello:
Put it in your doGet or doPost...it depends on your processing needs. String a=request.getParameter("x")

Bosun
thankes bosun
but i know this method and it doesn't help me cause it doesn't get the parameter value it gets the parameter name and on radio buttons you put the same name but different value for each option
and my problem is that i can't get the value

 
ninad parkhi
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi yoop,
Try to us getParameterNames() instead of getParameterValue().
You can store all the values of Radio Button in String array
and later can use them.
I think this will solve your problem
bye
ninad

 
Maky Chopra
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yoop,
The javaranch has a naming policy and your login name does not meet the requirement.
Please signup again with a proper name.
Thanks..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic