I was able to do it. selection of radio buttons
if(radio value==(value of 1st radio button))
{
for(String x : list)
{
try {
output 1
RequestDispatcher dispatcher =request.getRequestDispatcher("1st.jsp");
dispatcher.forward(request, response);
return;
}
catch {
output 2
RequestDispatcher dispatcher =request.getRequestDispatcher("2nd.jsp");
dispatcher.forward(request, response);
return;
}
}
}
else{
for(String x : list)
{
try {
output 1
RequestDispatcher dispatcher =request.getRequestDispatcher("1st.jsp");
dispatcher.forward(request, response);
return;
}
catch {
output 2
RequestDispatcher dispatcher =request.getRequestDispatcher("2nd.jsp");
dispatcher.forward(request, response);
return;
}
}
}
based on this it will go to one of the jsp pages depending upon the selection of radio buttons.
I hope this will help people in the future too.
thanks all for helping me out.