• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to get the radio value in another jsp page

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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





 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic