File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP redirection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP redirection" Watch "JSP redirection" New topic

JSP redirection

Nick Verma

Joined: Oct 27, 2004
Posts: 9

I have two drop down boxes and depending on the value selected the appropriate jsp page should be loaded. I am wrong somewhere. Please let me know where I am wrong.
<form method = "post" action = "servers.jsp">
<select name="superbapi1">
<option name="server1" value = "temp1" />
<option name="server1" value = "temp2" />
<input type = "submit" value = "Submit" />
<select name="superbapi2">
<option name="server2" value = "temp1" />
<option name="server2" value = "temp2" />
<input type = "submit" value = "Submit" />
String name1 = request.getParameter("server1");
String name2 = request.getParameter("server2");
<jsp:forward page = "status_sb1.jsp?server=temp1"%>

<jsp:forward page = "status_sb1.jsp?server=temp2" %>
<jsp:forward page = "status_sb2.jsp?server=temp1" %>
<jsp:forward page = "status_sb2.jsp?server=temp2" %>

Thanks for your help.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63534

Perhaps some insight on what "I am wrong somewhere" means would help?

[Asking smart questions] [About Bear] [Books by Bear]
Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 364
You need to look for the name of the select box, not the name of the option. Your request params are null here...

No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: JSP redirection
It's not a secret anymore!