• 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: 2369
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!