title: Post array by ajax to Spring boot controller
body: <p>my ajax function called as </p>
  
  <pre><code>    $.ajax({
              url:'${pageContext.request.contextPath}'+'/admin/sendMsg',
              method:'POST',
              traditional: true,
              data:{
                  driverList: JSON.stringify(drivers),
                  constList: JSON.stringify(constIds),
                  content: content
              },
              success: function(data) {
                          if (data == "FAIL") {
                              alert("File not found!");
                          } 
                      },
                      error: function(request, status, error) {
                          alert("The request failed: " + request.responseText);
                      }
          });
  </code></pre>
  
  <p>Where variable "drivers" and "constIds" are array object, output by browser console like </p>
  
  <pre><code>["0", "31", "30"]
  0: "0"
  1: "31"
  2: "30"
  length: 3__proto__: Array(0)
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>@ResponseBody
      @RequestMapping(value = "/sendMsg", method = RequestMethod.POST)
      public void sendMsg(HttpSession session,
              @RequestParam(value = "driverList")String[] driverList,
              @RequestParam(value = "constList")String[] constList, @RequestParam(value = "content")String content)
  {
      for (String data : driverList) {
           System.out.println("Your Data =&gt;" + data);
      }
      System.out.println(constList);
  
  }
  </code></pre>
  
  <p>But the output is </p>
  
  <pre><code>Your Data =&gt;["0"
  Your Data =&gt;"31"
  Your Data =&gt;"30"]
  </code></pre>
  
  <p>So how can I get rid of those brackets, then I can parse the string to Integer.</p>