title: POSTing JSON to Spring MVC Controller Returns 400 Bad Request
body: <p>I'd like to POST JSON and have Jackson convert it to a POJO, but for now I can't even POST a simple String parameter.</p>
  
  <ol>
  <li><p>I'm using Jackson 2.3.2 (jackson-core and jackson-databaind)</p></li>
  <li><p>I'm using Spring 3.2.8.RELEASE (spring-context, spring-webmvc)</p></li>
  <li><p>My Controller looks like this:</p>
  
  <pre><code>@RequestMapping(value="add-name", method=RequestMethod.POST, headers = "Accept=application/json")
  public String addName(@RequestParam(value = "name", required = false) String name) {
      LOG.info(String.format("name: %s", name));
      return "name";
  }
  </code></pre></li>
  <li><p>I POST to this Controller with data like this:</p>
  
  <pre><code>{ "name" : "my_name" }
  </code></pre></li>
  <li><p>The response I receive is <code>400 Bad Request</code></p></li>
  </ol>
  
  <p>Note: I'm submitting the POST via <a href="http://api.jquery.com/jQuery.post/" rel="nofollow">jQuery.post()</a>, but to remove that as a variable, I'm also submitting POST via <a href="https://addons.mozilla.org/en-US/firefox/addon/poster/" rel="nofollow">FF Poster add-on</a> specifying the URL, Content Type (application/json), and data as above.</p>
  
  <p><strong>Edit:</strong> I think the issue may be that the Jackson library isn't even being called. I took it out of the dependencies and nothing changes, no different error/exception, I still simply get a <code>400 Bad Request</code> response.</p>
  
  <p><strong>Edit 2:</strong> Even if I take out the parameter to <code>addName</code> completely and post an empty body <code>{}</code> I still get a <code>400 Bad Request</code></p>