This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting null values from HttpServletRequest.getParameter() method

 
Pratik Tari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Pratik Tari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic