title: receiving json and deserializing as List of object at spring mvc controller
body: <p>My code is as below:</p>
  
  <p><strong>controller</strong></p>
  
  <pre><code>@RequestMapping(value="/setTest", method=RequestMethod.POST, consumes="application/json")
  public @ResponseBody ModelMap setTest(@RequestBody List&lt;TestS&gt; refunds, ModelMap map) {
      for(TestS r : refunds) {
          System.out.println(r.getName());
      }
      // other codes
  }
  </code></pre>
  
  <p><strong>TestS pojo</strong></p>
  
  <pre><code>public class TestS implements Serializable {
      private String name;
      private String age;
      //getter setter
  }
  </code></pre>
  
  <p><strong>Json request</strong></p>
  
  <pre><code>var z = '[{"name":"1","age":"2"},{"name":"1","age":"3"}]';
  $.ajax({
      url: "/setTest",
      data: z,
      type: "POST",
      dataType:"json",
      contentType:'application/json'               
  });
  </code></pre>
  
  <p>It's giving this error </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.air.cidb.entities.TestS</p>
  </blockquote>
  
  <p>I am using <strong>spring 3.1.2</strong> and <strong>jackson 2.0.4</strong></p>
  
  <p><strong>Edit:</strong> I want to receive list of TestS objects at my controller method, and process them. I am not able to find if I am sending wrong json or my method signature is wrong.</p>