Win a copy of Kotlin in Action this week in the Kotlin 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
Rancher
Posts: 2914
36
  • 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: 999
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!