title: How to map array in JSON to array/List in Spring MVC controller
body: <p>I 've been searching for many posts but I can't find a simple solution.</p>
  
  <p>I need to post a JSON object, with a property of array to the controller and map each property correctly.</p>
  
  <p>For many attempts , I use below work around to achieve :</p>
  
  <p>The to exitsingUsers is somehow like: </p>
  
  <pre><code>[1,2,3,4,5]
  </code></pre>
  
  <p>and the param I post is:</p>
  
  <pre><code>$.ajax({
       url: XXXXX.do",
       type:'POST',
       data:{
          disableUserIdsJSON: JSON.stringify(exitsingUsers),//I stringify the array here
          //may have somethingelse: 'else',....
      },
  </code></pre>
  
  <p>In the controller , I write this to parse the param:</p>
  
  <pre><code>public List&lt;User&gt; getUserList(@RequestParam String disableUserIdsJSON,HttpSession session) throws IOException, SQLException {//here i accept the param as String
      List&lt;Integer&gt; exceptUserIds = new ObjectMapper().readValue(disableUserIdsJSON,new TypeReference&lt;List&lt;Integer&gt;&gt;(){});//parse the string back to list
  </code></pre>
  
  <p>I do hope to not transform the JSON to string and then parse the string in java code,which is not intuitive.</p>
  
  <p>Is there a way to <strong>directly</strong> map the param from to a java List/array in Spring MVC? </p>