Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

to get the radio value in another jsp page

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
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.
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


I brought this back from the farm where they grow the tiny ads:
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic