aspose file tools*
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
Author

getParameter() method gives null

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1109
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getParameter() method gives null