Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass radio button/ text box responses from one page to another

 
madhankumar kumaravelu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello

I have a jsp screen1 with lot of radio buttons and a text box.

Once some of these radio buttons are selected and text box typed with a value
and submit button clicked, it has to update the postgre DB with the selected radio
button's text and the text box value.

On successfull updation of DB, it has to redirect to a jsp screen 2.

Currently i have the jsp screen 1 but i dont know how to get responses and proceed.

Please help me with a sample code.

It is urgent!

 
Stefan Evans
Bartender
Pie
Posts: 1669
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds simple enough...

The form on jsp screen 1 has to have an action that will invoke a servlet




In your servlet doPost method, you retrieve the values of the parameters with request.getParameter(), and then invoke some JDBC code to save them.


and then get a request dispatcher and forward to the next jsp:

 
subbu kanna
Greenhorn
Posts: 4
Eclipse IDE Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir,

String selectedRadio = request.getParameter("radioControlName");
String inputText = request.getParameter("textfieldControlName");

the request.getparameter("radiocontrolname") if null then how do we check it

if(request.getParameter("radio")==null)
out.println("user did not choosen");

but the if condition not checking, I have this problem in jsp registration page . please guide me in this regard


regards
kanna
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic