title: Spring and ExtJS “Bad Request” with POST method
body: <p>I'm trying to send parameters with POST from Ext JS to a Spring application. Here is the my Controller:</p>
  
  <pre><code>@RequestMapping(value = "/unloadCatalog", method = RequestMethod.POST)
  public void unloadMappingCatalog(@RequestParam(required = true) String jsonString,
                                   HttpServletRequest request, HttpServletResponse response)
  {
  </code></pre>
  
  <p>And here the Ext JS snippet that I'm using to send those parameter:</p>
  
  <pre><code>var unloadData = Ext.encode(listObjects);
  Ext.Ajax.request({
      url:'content/unloadCatalog',
      method: 'POST',
      params:{
          jsonString: unloadData
      },
      success: function(response, opts){
          // do something
      }
  });
  </code></pre>
  
  <p>But if I send json data <code>unloadData</code> as body data</p>
  
  <pre><code>Ext.Ajax.request({
      url:'content/unloadCatalog',
      method: 'POST',
      jsonData: unloadData,
      success: function(response, opts){
          // do something
      }
  });
  </code></pre>
  
  <p>and change my Controller like this:</p>
  
  <pre><code>@RequestMapping(value = "/unloadCatalog", method = RequestMethod.POST)
  public void unloadMappingCatalog(@RequestBody String jsonString,
                                 HttpServletRequest request, HttpServletResponse response)
  {
  </code></pre>
  
  <p>everything works fine. Why doesn't works first case?</p>