Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Submit from a JSP page based on a choice  RSS feed

 
Ishita Saha
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a JSP page where I have given two choices to the user.
Now based on the selected choice - I have to submit the form to a servlet.

To be specific there are two radio buttons -
if user select radio button 1 - he should be redirected to URl abc
if user select radio button 2 - he should be redirected to URl xyz

could anybody please guide me what approach I should take
Thanks
 
ramakrishnan natarajan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
to be simple you can set as response.sendRedirect("http://www.abc.com"); since i have given you how to redirect from that page after clicking submit.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


in servlet get radio button value using
request.getParameter("radio_value");

then based on the values you redirect to the particular jsp by using response.sendRedirect("jsp_file");


thanks & regards,
seetharaman
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!