my dog learned polymorphism
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
JavaRanch » Java Forums » Java » JSP
Bookmark "getParameter() method gives null" Watch "getParameter() method gives null" New topic

getParameter() method gives null

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1240
there are two jsp files in this has 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

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

Joined: Jun 06, 2007
Posts: 2851

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

|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

Joined: Sep 29, 2008
Posts: 12617

Heh, I didn't even see that--I just saw the bad table cell/row nesting!
I agree. Here's the link:
subject: getParameter() method gives null
It's not a secret anymore!