| 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: 56192
|
|
|
Perhaps some insight on what "I am wrong somewhere" means would help?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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
|
|
|