Author
getParameter() method gives null
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
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
posted Apr 02, 2009 17:26:25
0
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: 2551
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
posted Apr 03, 2009 07:18:41
0
Heh, I didn't even see that--I just saw the bad table cell/row nesting!
subject: getParameter() method gives null