This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes getParameter() method gives null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "getParameter() method gives null" Watch "getParameter() method gives null" New topic
Author

getParameter() method gives null

sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1073
there are two jsp files in this example.one has form.it send to the other jsp.
i used getParameter() method to get the values.but only first one gives the valus.others give null.
i coudn't find the error?



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Is that really your HTML? Its invalid nature might prevent some browsers from processing it correctly.

Have you confirmed that the parameters are being sent (via Firebug, proxy, etc.)?
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

And you are using scriptlets in your JSP, something not recommended at all. Try EL.


SCJP, SCWCD.
|Asking Good Questions|
Sri Gnana
Ranch Hand

Joined: Apr 29, 2004
Posts: 166
Check with your html text field names.

See the highlighted part
tr><td>Name<input type="text" name="name"></tr></tr>
<tr><td>Age<input type="text" name="age"></tr></tr>
<tr><td>Address<input type="text" name="address"></tr></tr>
<tr><td><input type="submit" name="submit"></tr></tr>


Actually you have to use "name" only, thats the tag to refer the name of the text field.


Thanks & Regards
Sri Gnana
Everythings Programmed!...
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Heh, I didn't even see that--I just saw the bad table cell/row nesting!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: getParameter() method gives null
 
Similar Threads
NULL
include directive doesn't work
request.getAttribute Not Displaying Anything In JSP
Not able to set attribute in JSP
request time expression