title: Send data from JSP to servlet
body: <p>Here are my needs : </p>
  
  <p>In a jsp I fill a "table" using javascript (My first "tr" is the titles, the second "tr" is the inputs then all new "tr" are added with a javascript function)</p>
  
  <p>Now I want to send the values of my table to a servlet. <strong>I do not use the jquery framework</strong> </p>
  
  <p>Here is what I've done in js :</p>
  
  <pre><code>function test(){
      var strPar= "Blabla BLABLA BLA";
      var toServer = JSONObject.toJSONString(strPar);
      alert("TEST U MF !!!");
      var request = new XMLHttpRequest();
      request.open("POST", "http://localhost:8084/Calendar/Legal", true);
      request.send(toServer);
      alert("POUET !");
  }
  </code></pre>
  
  <p>I doesn't seem to work at all ! Moreover I have no idea on how to get the JSON object from the servlet ?</p>
  
  <pre><code>public class LegalCalServlet extends HttpServlet {
  
  /**
   * Processes requests for both HTTP &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;
   * methods.
   *
   * @param request servlet request
   * @param response servlet response
   * @throws ServletException if a servlet-specific error occurs
   * @throws IOException if an I/O error occurs
   */
  protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
  
      System.out.println("TEST ");
      String output = request.getParameter("strPar");
      System.out.println(output);
  
  }}
  </code></pre>
  
  <p>I would very appreciate any help on this please !</p>