title: Ajax HTTPServlet request does not pass information from ajax to controller
body: <p>My controller on java side is not receiving the information i send with my AJAX
  It worked in the beginning but now it does not work, it keeps returning null.</p>
  
  <p>I've tried:
  Changing parameter name
  Putting parameter name in ""
  Calling methods that get the information from registrationform directly in Ajax</p>
  
  <p>The information is coming in in Javascript, and is sending a Arraylist.</p>
  
  <p>Javascript:</p>
  
  <pre><code>$("#registrationForm").submit(function() {
      $.ajax({
          type : 'POST',
          data : {
              "allInformation" : getAllCorrectInformation(),
              hasCode : $("#course_option-1").is(":checked"),
              fullPayment : $(".fullPayment").is(":checked"),
              allSecondInformation : getAllSecondInformation(),
          },
          url : 'FormController',
          success : function(result) {
  
          }
      });
      return false;
  });
  
  function getAllCorrectInformation() {
      var allMainInformation = [];
      if($("#course_option-1").is(":checked")) {
          allMainInformation.push($("#courseCode").val());
      }
      // Cursist
      allMainInformation.push($("#gender").val());
      allMainInformation.push($("#birthday").val());
      allMainInformation.push($("#firstName").val());
      allMainInformation.push($("#insertion").val());
      allMainInformation.push($("#lastName").val());
      // ALS KINDERVERSIE !!LATER AANPASSEN!!
      allMainInformation.push($("#parentsName").val());
      allMainInformation.push($("#addressNr").val());
      allMainInformation.push($("#zipCode").val());
      allMainInformation.push($("#email").val());
      allMainInformation.push($("#phoneNumber").val());
      // Payment
      if($(".fullPayment").is(":checked")) {
          allMainInformation.push($("#bank").val());
      } else {
          allMainInformation.push($("#nameAccountHolder").val());
          allMainInformation.push($("#iban").val());
      }
      return allMainInformation;
  }
  
  function getAllSecondInformation() {
      var allSecondInformation = [];
      $(".secondPersonContainer").each(function() {
          if($(this).css("display")!="none") {
              allSecondInformation.push($(this).find(".secondGender").val());
              allSecondInformation.push($(this).find(".secondBirthday").val());
              allSecondInformation.push($(this).find(".secondFirstName").val());
              allSecondInformation.push($(this).find(".secondInsertion").val());
              allSecondInformation.push($(this).find(".secondLastName").val());
          }
      });
      return allSecondInformation;
  }
  </code></pre>
  
  <p>FormController.java</p>
  
  <pre><code>package houseoftyping.controller;
  
  import java.io.IOException;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import houseoftyping.domain.Registration;
  
  /**
   * Servlet implementation class FormController
   */
  @WebServlet("/FormController")
  public class FormController extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      /**
       * @see HttpServlet#HttpServlet()
       */
      public FormController() {
          super();
          // TODO Auto-generated constructor stub
      }
  
      /**
       * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          response.setContentType("text/plain");
  
          if(request.getParameterNames().hasMoreElements()) {
              System.out.println(request.getParameterNames().nextElement());
          }
  
          System.out.println(request.getParameter("allInformation[]"));
          List information = Arrays.asList(request.getParameter("allInformation").split(","));
  
          List secondInformation = Arrays.asList(request.getParameter("allSecondInformation").split(","));
          Registration registration = new Registration(information, Boolean.parseBoolean(request.getParameter("hasCode")), Boolean.parseBoolean(request.getParameter("fullPayment")), secondInformation);
          PrintWriter out = response.getWriter();
      }
  
      /**
       * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
          doGet(request, response);
      }
  
  }
  
  </code></pre>