title: HTML5 FormData returns null in Java Servlet request.getParameter()
body: <p>My view is HTML 5. I'm using FormData to make a AJAX 2 POST to a Servlet. Inside the servlet i'm trying to read request parameters. I can't see any parameters. However, Google Chrome Dev console shows the request payload. How can I get the same in Servlet code? Any help will be appreciated. Here's the code.</p>
  
  <p>JS code</p>
  
  <pre><code>var xhr = new XMLHttpRequest();
  var formData = new FormData();
  formData.append('firstName', 'ABC');
  formData.append('lastName', 'XYZ');
  
  xhr.open("POST", targetLocation, true);
  xhr.send(formData);
  </code></pre>
  
  <p>Servlet code (both parameters return <code>null</code>)</p>
  
  <pre><code>out.println("Hello! "+ request.getParameter("firstName")+ " "+ request.getParameter("lastName")+ ", thanks for sending your feedback." );
  </code></pre>
  
  <p>Google Chrome Console</p>
  
  <pre><code>Content-Disposition: form-data; name="firstName"
  XYZ
  Content-Disposition: form-data; name="lastName"
  ABC
  </code></pre>