• Post Reply Bookmark Topic Watch Topic
  • New Topic

to get the radio value in another jsp page

 
deepakkk gupta
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am currently using a jsp named findtrain.jsp" where i used a radio button to select a train from the list..
and then on clicking the bookticket user is forwarded to a bookticket.jsp in a new window...
where i am using request.getParameter(" xyz");
but i am getting a null value ......


i also tried to use the hidden fields but it's not working and the bookticket.jsp is still giving null value
please help
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parameters are only valid for a single request.

There are two approaches. Either use (like you have already tried) hidden fields. I think there is something wrong with your approach that didn't work because it is a valid way of processing parameters over multiple pages.

The second approach would be setting the parameters you need as a session attribute. If you carry your parameters over more than 2 pages, it can get cumbersome to always set hidden fields and then storing them in a session is the cleanest approach.
 
Mayur Mayuresh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I understand is, you are having a table with list of trains out of which you are selecting one through radio button.
If I am not wrong, then try the following code :

Create two hidden variable inside your form :




Put this structure in your table :



Now in javascript put the following code :



And now on next jsp, try to get parameter 'radioValue'.

The code is as per my needs (it is passing values servlet & futher).... So modify it to work done

Hope it may work for you ! Best Luck

Thanks





 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!