• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Values are getting printed as nulls in Servlet

 
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: 1899
14
  • 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: 981
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic