title: Get parameter sent via jquery ajax in Java Servlet
body: <p>I search this topic on web but I can't get a example that worked.
  I will be gladed with someone could give me a help.</p>
  
  <p>this is what I testing.</p>
  
  <pre><code> $.ajax({
      url: 'GetJson',
      type: 'POST',        
      dataType: 'json',
      contentType: 'application/json',
  
      data: {id: 'idTest'},
      success: function(data) {
          console.log(data);
      }
  });
  </code></pre>
  
  <p>in Sevlet</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
  
      String id = request.getParameter("id");
      String id2[] = request.getParameterValues("id");        
      String id3 = request.getHeader("id");
  
  }
  </code></pre>
  
  <p>I'm getting null in everything.</p>