?
Solved

Using getParameter getting null

Posted on 2005-04-01
5
Medium Priority
?
244 Views
Last Modified: 2010-04-01
I'm trying to pass a value to another page and then pass it again to the servlet.  When I post the data to the next page i'm getting  - null.  What am I doing wrong?


<html>
<head>
</head>

<body>
<form name="form" method="post" action="client?action=<%= RequestServlet.REDIRECT %>&firstEntry=<%= request.getParameter("firstentry") %>">
<input type="text" name="firstEntry">
 
  <input type="submit" name="Submit" value="Submit">
</form>

</body>


</html>



0
Comment
Question by:javabeginr
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 13683100
if you are creating it on the url why u have it on the page as well???

go to this page do a right click -- view source.. post the generated HTML here.. that should help
0
 

Author Comment

by:javabeginr
ID: 13683263
What is it ?  You mean the input name?  Here's the code.

<html>
<head>
</head>

<body>
<form name="form" method="post" action="client?action=2&firstEntry=null">

<input type="text" name="firstEntry">
 
  <input type="submit" name="Submit" value="Submit">
</form>

</body>
</html>



0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 2000 total points
ID: 13683303
you are getting it null here on this page itself...

<form name="form" method="post" action="client?action=2&firstEntry=null">...
i.e. the page thats calling this page is not sending the passing it to this page..
are you sure that the first is sending variable name as ("firstentry")  because thats what you are trying to get in this page..
and remember java is case sensetive..
you most probably are looking for ("firstEntry") instead of ("firstentry")
0
 

Author Comment

by:javabeginr
ID: 13683337
Thanks, I figured it out.  
0
 

Author Comment

by:javabeginr
ID: 13683351
You're right I had a getParameter on the second page as firstentry instead of firstEntry.  
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Case Study of using the Windows API to provide RS232 communications capability in Access without the use of Active-X controls.
The deadly train derailment that occurred recently in DuPont, Washington, raises a lot of questions. It was a new route, the first trip tested with passengers, and the train was travelling at 50 mph over the zone’s speed limit. Could IoT play a role…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question