473,749 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

request.getPara meter value passing null

14 New Member
ok I canged my code around...no more javascript...th e problem now is the 'weatherStae" parameter is passing 'null' in request.getPara meter...any suggestions??

1st jsp:

Expand|Select|Wrap|Line Numbers
  1. <form name="form1" method="POST" action="/JAABA/jsp/cpanel/cp-weatherFive.jsp">
  2.  
  3. <label for="weatherState">State:</label>
  4.  
  5. <select name="weatherState" >
  6.  
  7. <% for (int i=0; i< theStates.size(); i++) {  %>
  8.  
  9. <OPTION VALUE="<%=theStates.elementAt(i)%>"><%=theStates.elementAt(i)%></OPTION>
  10.  
  11.  
  12.  
  13. <% 
  14. }
  15. %>
  16. </select>
  17.  
  18.  
2nd jsp:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%
  3. System.out.println("error...: "+request.getParameter("weatherState"));//--this is coming back null??
  4. String sValue = request.getParameter("weatherState");
  5. Vector theCities = WeatherDAO.getWeatherCities(sValue);
  6. %>
  7.  
  8.  
Sep 11 '07 #1
7 14692
dmjpro
2,476 Top Contributor
ok I canged my code around...no more javascript...th e problem now is the 'weatherStae" parameter is passing 'null' in request.getPara meter...any suggestions??

1st jsp:

Expand|Select|Wrap|Line Numbers
  1. <form name="form1" method="POST" action="/JAABA/jsp/cpanel/cp-weatherFive.jsp">
  2.  
  3. <label for="weatherState">State:</label>
  4.  
  5. <select name="weatherState" >
  6.  
  7. <% for (int i=0; i< theStates.size(); i++) {  %>
  8.  
  9. <OPTION VALUE="<%=theStates.elementAt(i)%>"><%=theStates.elementAt(i)%></OPTION>
  10.  
  11.  
  12.  
  13. <% 
  14. }
  15. %>
  16. </select>
  17.  
  18.  
2nd jsp:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%
  3. System.out.println("error...: "+request.getParameter("weatherState"));//--this is coming back null??
  4. String sValue = request.getParameter("weatherState");
  5. Vector theCities = WeatherDAO.getWeatherCities(sValue);
  6. %>
  7.  
  8.  
Show me the code of the Form which getting Submitted and calling this Jsp.
You can also try this one, whether weatherState parameter comes or not.

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Enumeration param_names = request.getParameterNames();
  3. while(param_names.hasMoreElements()){ if(param_names.nextElemenet().equals("weatherState")) System.out.println("Yahooo............Parameter found by that name.");
  4. System.out.println("Parameter_Names: " + param_names.nextElemenet());
  5. }
  6. %>
  7.  
Good Luck.

Kind regards,
Dmjpro.
Sep 12 '07 #2
dmjpro
2,476 Top Contributor
ok I canged my code around...no more javascript...th e problem now is the 'weatherStae" parameter is passing 'null' in request.getPara meter...any suggestions??

1st jsp:

Expand|Select|Wrap|Line Numbers
  1. <form name="form1" method="POST" action="/JAABA/jsp/cpanel/cp-weatherFive.jsp">
  2.  
  3. <label for="weatherState">State:</label>
  4.  
  5. <select name="weatherState" >
  6.  
  7. <% for (int i=0; i< theStates.size(); i++) {  %>
  8.  
  9. <OPTION VALUE="<%=theStates.elementAt(i)%>"><%=theStates.elementAt(i)%></OPTION>
  10.  
  11.  
  12.  
  13. <% 
  14. }
  15. %>
  16. </select>
  17.  
  18.  
2nd jsp:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%
  3. System.out.println("error...: "+request.getParameter("weatherState"));//--this is coming back null??
  4. String sValue = request.getParameter("weatherState");
  5. Vector theCities = WeatherDAO.getWeatherCities(sValue);
  6. %>
  7.  
  8.  
Let me clarify one thing.
Expand|Select|Wrap|Line Numbers
  1. <label for="weatherState">State:</label>
  2. <select name="weatherState" ></select>
  3.  
Here the name weatherState occurred twice.
Please tell me what is function of first one.......<Label>?

Kind regards,
Dmjpro.
Sep 12 '07 #3
mimsc
14 New Member
Let me clarify one thing.
Expand|Select|Wrap|Line Numbers
  1. <label for="weatherState">State:</label>
  2. <select name="weatherState" ></select>
  3.  
Here the name weatherState occurred twice.
Please tell me what is function of first one.......<Label>?

Kind regards,
Dmjpro.

I just noticed that also...im gonna remove that label...and run that...I'll be back with the results
Sep 12 '07 #4
r035198x
13,262 MVP
You are still using Vector ...
Sep 12 '07 #5
mimsc
14 New Member
Show me the code of the Form which getting Submitted and calling this Jsp.
You can also try this one, whether weatherState parameter comes or not.

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Enumeration param_names = request.getParameterNames();
  3. while(param_names.hasMoreElements()){ if(param_names.nextElemenet().equals("weatherState")) System.out.println("Yahooo............Parameter found by that name.");
  4. System.out.println("Parameter_Names: " + param_names.nextElemenet());
  5. }
  6. %>
  7.  
Good Luck.

Kind regards,
Dmjpro.
thasnx man..I tried that....this is the message I get: "java.util.NoSu chElementExcept ion"

im confused..I thought the request.getPara meter() picked up that first label...I removed that and the same thing....can you see anything else...maybe the form??
Sep 12 '07 #6
mimsc
14 New Member
You are still using Vector ...
does that matter?...If I hardcode "FL" or any other state in mysecond jsp....no problems
Sep 12 '07 #7
mimsc
14 New Member
i figured it out...MINOR problem.....did nt submit the form!!!!!!!!!!! !!...dammit!!!! !
Sep 12 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5986
by: efiedler | last post by:
Hi - I have the following input field on my html page: <input type="image" name="submit" id="submit" src="c:\image.jpg" value="image.jpg"> I also have another input field on the form that is a text box. When submitted my form posts its data to a servlet. I can click on the image, and the form is posted and the servlet is ran. However, I was stepping through the debuger of the servlet and I noticed the request
9
28941
by: Sunny | last post by:
Hi, I have cr8ed a javascript function in the head section of a jsp page. <!-- function go(theURL) { alert(theURL); if (theURL!=null){
3
1976
by: jrefactors | last post by:
page0.asp->page1.jsp When the user click submit button in page0.asp, it will post the form request to page1.jsp. page0.asp and page1.jsp are in separate machines. In page1.jsp, based on the parameter interfaceName, it will forward to different jsp pages. However, we want to forward the request to a window with parameter like the following, without the menu bar and toolbar.
1
8472
by: wawa_piggy | last post by:
My .net application is to consume a Java web services exposed using AXIS. The web service will extract the user name and password to perform some custom authentication. /** Java **/ userId = hReq.getParameter("wsUserName"); password = hReq.getParameter("wsPassword"); So my ASP.net application will need to set the user id and password to be passed as a HTTP request parameters
10
2198
by: William L. Bahn | last post by:
I'm looking for a few kinds of feedback here. First, there is a program at the end of this post that has a function kgets() that I would like any feedback on - including style. Second, for those that are interested, I present an outline of the approach I am looking at using in class this semester. I would be very interesting in any feedback on that, but if you are not interested, feel free to skip over it.
8
2102
by: Angel | last post by:
I am trying to access in Javascript within an ASP.NET web page the Request Object. I am specifically trying to access the values in the Request.QueryString. When I try to access the values I get an error specifying that the Request object is undefined... The Jscript code is as follows: alert(Request.QueryString("CASE")); In any thoughts or am Is my syntax incorrect. I need to be able to access the QueryString from within jscript...
6
4978
by: santhoskumara | last post by:
How to request to servlet from Ajax and also I got the DOM object in the servlet through Business Logic. Now how will i pass the DOM object from serlvet to Clientside. Where in the client Side i am using Ajax. kindly advice me.
0
2921
by: buntyindia | last post by:
Hi, I have a very strange problem with my application. I have developed it using Struts. I have a TextBox With Some fixed value in it and on Submit iam passing it to another page. <html:form action="/login"> <html:text property="userName" value="Bunty"/> <html:submit/>
3
2292
by: vijaykumardahiya | last post by:
Dear Sir, I have two queries. First question is: I have a Html page. On which Have two buttons Submit and Issue. I want when I click on Sumit button request should be go to submit.jsp. and When I click on Issue button then request should be go to Issue.jsp.But When I click on submit button request do to Issue.jsp. Second Question is How I reterive the input parameter of html page to submit.jsp. Please review.. My files are: login.html:
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8256
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.