| | |
request.getParameter value passing null
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2007
Posts: 66
Reputation:
Solved Threads: 0
any suggestions...my "weatherState" value doesnt seem to be passing over:
1st jsp:
2nd jsp:
1st jsp:
JSP Syntax (Toggle Plain Text)
<% Vector theStates = WeatherDAO.getWeatherStates(); %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </script> <body> <TR bgColor="#ffffff"><TD COLSPAN="2"> <TABLE CELLPADDING="3" CELLSPACING="2"> <TR><TD> </FONT></CENTER><BR> <BR> <TABLE BORDER="0" CELLSPACING="5" CELLPADDING="5" WIDTH="100%"> <TR BGCOLOR="#C0C0C0" ><TD COLSPAN="2" ALIGN="CENTER"> <FONT SIZE=+3><B> Weather Services</B></FONT> </TD></TR> </TABLE> <HR SIZE="3" NOSHADE> <font size=+1>Choose a state and press continue</font><br> <TR><TD> <center> <form name="form1" method="POST" action="/JAABA/jsp/cpanel/cp-weatherFive.jsp"> <label for="weatherState">State:</label> <select name="weatherState" > <% for (int i=0; i< theStates.size(); i++) { %> <OPTION VALUE><%=theStates.elementAt(i)%></OPTION> <% } %>
2nd jsp:
JSP Syntax (Toggle Plain Text)
<% System.out.println("error...: "+request.getParameter("weatherState")); String sValue = request.getParameter("weatherState"); Vector theCities = WeatherDAO.getWeatherCities(sValue); %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <body> <TR bgColor="#ffffff"><TD COLSPAN="2"> <TABLE CELLPADDING="3" CELLSPACING="2"> <TR><TD> </FONT></CENTER><BR> <BR> <TABLE BORDER="0" CELLSPACING="5" CELLPADDING="5" WIDTH="100%"> <TR BGCOLOR="#C0C0C0" ><TD COLSPAN="2" ALIGN="CENTER"> <FONT SIZE=+3><B> Weather Services</B></FONT> </TD></TR> </TABLE> <HR SIZE="3" NOSHADE> <font size=+1>Select the State and City for which you would like to receive weather information.</font><br> <TR><TD> <center> <label for="weatherCity">City:</label> <select name="weatherCity" > <% for (int i=0; i< theCities.size(); i++) { %> <OPTION VALUE=<%=theCities%>> <%=theCities.elementAt(i)%> </OPTION> <% } %>
It could probably be because you need to specify id for the select element. Some browsers pass data based on id, others based on the name attribute. To be safe, it is a good practice to define the id and the name.
JSP Syntax (Toggle Plain Text)
<select id="weatherState" name="weatherState" >
![]() |
Similar Threads
- day in a calender (JSP)
- Calling if() again in JSP (JSP)
- Replacement of goto???? (JSP)
- new to javascript (JSP)
- Unsure how to save to database dynamic Textfield values (JSP)
- Request.getParameter() (Java)
- getting error (JSP)
- change statement (JSP)
Other Threads in the JSP Forum
- Previous Thread: can anybody guide me
- Next Thread: Another MySQL issue...
Views: 11342 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for JSP
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient project read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write





