• 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

Submit from a JSP page based on a choice

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic