title: Spring MVC and jquery post request with array of POJO
body: <p>I have a simple POJO Java class (getters and setters is not shown)</p>
  
  <pre><code>public class VacationInfo {
  
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;
  
  @Temporal(TemporalType.TIMESTAMP)
  private Date vacationFrom;
  
  @Temporal(TemporalType.TIMESTAMP)
  private Date vacationTo;
  </code></pre>
  
  <p>, Spring MVC controller with next method</p>
  
  <pre><code>@RequestMapping(value = "updateVacations", method = RequestMethod.POST)
  public String updateVacations(@RequestParam VacationInfo[] vacationInfos) {
      ...
  }
  </code></pre>
  
  <p>and jQuery post request</p>
  
  <pre><code>    $.ajax({
        type: "POST",
        url: "updateVacations",
        dataType: 'json',
        data: vacationInfos
      });
  </code></pre>
  
  <p>where "vacationInfos" is a array with JSON objects, which represent VacationInfo class:</p>
  
  <pre><code>[
   {
    vacationFrom: "01-01-2013",
    vacationTo: "01-01-2013"
   },
   {
    vacationFrom: "01-01-2013",
    vacationTo: "01-01-2013"
   }
  ]
  </code></pre>
  
  <p>But when I do request - i got a HTTP 400 error.</p>