• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Values are getting printed as nulls in Servlet

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You seem to access the form through its id, however it does not appear to have one.
 
Goodbye moon men. Hello tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic