• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
 
She'll be back. I'm just gonna wait here. With this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic