aspose file tools
The moose likes Servlets and the fly likes getting null values from HttpServletRequest.getParameter() method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "getting null values from HttpServletRequest.getParameter() method" Watch "getting null values from HttpServletRequest.getParameter() method" New topic
Author

getting null values from HttpServletRequest.getParameter() method

Pratik Tari
Greenhorn

Joined: Jan 14, 2013
Posts: 11
My servlet class(Mini MVC exercise in HeadFirst Servlets and JSP) follows,


//HTML


getting null values from getParameter() method

Please help.

Thanks



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56547
    
  14

What have you done to debug this? One of the most useful things to do is to turn on the debugger in the browser and actually look at the request. Is the parameter value there in the post body as expected? If yes, the problem is in servlet. If not, the problem is in the HTML.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Pratik Tari
Greenhorn

Joined: Jan 14, 2013
Posts: 11
Thanks Bear,

The Debugger helped, I used == to compare string objects in the model class, my bad. So it wasn't a null in first place.



Also thanks for info on how to post.
 
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: getting null values from HttpServletRequest.getParameter() method
 
Similar Threads
help needed with tomcat/requestDispatcher - example form HeadFirst servlets and jsp
Starting out on Servlets - from Head First Servlets and JSP
Unable to compile class for JSP
Why this EL code part is not working
Request Resource not available JSP