wood burning stoves*
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
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP redirection" Watch "JSP redirection" New topic
Author

JSP redirection

Nick Verma
Greenhorn

Joined: Oct 27, 2004
Posts: 9
Hello

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.
<HTML>
<BODY>
<form method = "post" action = "servers.jsp">
<h3>SUPER-1</h3><br/>
<select name="superbapi1">
<option name="server1" value = "temp1" />
<option name="server1" value = "temp2" />
<input type = "submit" value = "Submit" />
</select>
<h3>SUPER-2</h3><br/>
<select name="superbapi2">
<option name="server2" value = "temp1" />
<option name="server2" value = "temp2" />
<input type = "submit" value = "Submit" />
</select>
</form>
<%
String name1 = request.getParameter("server1");
String name2 = request.getParameter("server2");
if(name1="temp1"){
%>
<jsp:forward page = "status_sb1.jsp?server=temp1"%>
<%
}
%>

<%
if(name1="temp2"){
%>
<jsp:forward page = "status_sb1.jsp?server=temp2" %>
<%
}
%>
<%
if(name2="temp1"){
%>
<jsp:forward page = "status_sb2.jsp?server=temp1" %>
<%
}
%>
<%
if(name2="temp2"){
%>
<jsp:forward page = "status_sb2.jsp?server=temp2" %>
<%
}
%>
</BODY>
</HTML>

Thanks for your help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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


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

Joined: Nov 01, 2002
Posts: 363
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?
 
 
subject: JSP redirection
 
Similar Threads
jsp
Text Box Validation in JSP
pass the value to next form
Java script is not populated on webpage.
StringTokenizer error on JSP