473,837 Members | 1,787 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 14700
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
5995
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
28945
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
1984
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
8478
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
2203
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
2109
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
4985
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
2928
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
2298
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
9846
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
9691
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10582
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
10638
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
10280
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9418
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...
1
7821
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7009
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();...
3
3128
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.