Forums Register Login

Submit from a JSP page based on a choice

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
grapes are vegan food pellets. Eat this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1439 times.
Similar Threads
error in passing values from child window to parent window
Disable Submit Buttons
Processing icon with simple jsp approach
JSP and Radio Buttons
Writting controller.jsp
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:37:25.