Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Values are getting printed as nulls in Servlet  RSS feed

 
Venkata SaiKrishna
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

We are also facing the exact issue.
Values are getting printed as NULLs in Servlet.
Please find the below snippet.

Input values in Jsp:
<input type="text" name="deployLocation" value="<deployLocationValue>" />
<input type="hidden" name="migBuildLocation" value="<migBuildLocationValue>" />

Javascript code to submit form:
var form = document.getElementById("formId");
form.submit();

Servlet code from doPost method:
String deployLocationFromJsp = request.getParameter("deployLocation");
String migBuildLocationFromJsp = request.getParameter("migBuildLocation");
 
Dave Tolls
Ranch Hand
Posts: 2414
25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked what is being sent to the server in the request?
Use the developer tools for your browser and you will see the traffic.

Also, have you checked the HTML to see if there is anything shown in the fields?
 
Ivan Jozsef Balazs
Rancher
Posts: 992
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to access the form through its id, however it does not appear to have one.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!