File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes getParameter() method gives null Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "getParameter() method gives null" Watch "getParameter() method gives null" New topic
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

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
    
    2

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: getParameter() method gives null
 
Similar Threads
request.getAttribute Not Displaying Anything In JSP
include directive doesn't work
NULL
Not able to set attribute in JSP
request time expression