• Post Reply Bookmark Topic Watch Topic
  • New Topic

get the radio button value in three differnt jsp

 
deepakkk gupta
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hiii..
i hv some radio buttons on my jsp page ... say "jsp parent"
i want three buttons on "jsp parent" .each button would lead you to a different jsp page ...

suppose first button would forward the user to "jsp1" second on "jsp2" and third on "jsp3"....
i want to get the selected radio button value ..
when i click on first button i should get the select radio button value on "jsp1" and when i click second button i want selected radio button value on "jsp2"...
please help
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set the value in request or session variables and access through out the request or session.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
deepakkk gupta wrote:hiii..
i hv some radio buttons on my jsp page ...


Please use real words when posting to the forums. Abbreviations such as "hv" in place of "have" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
deepakkk gupta
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ruquia tabassum wrote:You can set the value in request or session variables and access through out the request or session.

i need two parameters to set the attribute in session or request first one is string and second which i want to store in that...
but problem is that how can i get the the selected radio button in the second parameter of setAttribute...

and remember these all thing should be done in "jsp parent" page because on any click i have to go differnt page and retrieve the value from the session there.
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On click of radio button you are calling a JSP in the JSP itself set the value in the session variable. For example if the radio button1 has the value Testjava button2 has value TestServlet and on click of button1 you are calling TestJava.jsp and on click of button2 you are calling TestServlet.jsp then in TestJava.jsp itself set the value of radio button in the variable as:-

session.setAttribut("button1Value","java");


Also for clear understanding of the issue its always better to post code .
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"deepakkk gupta",please check your private messages for an important administrative matter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!