title: How to enable @JsonRootName in spring mvc 3.2
body: <p>I'm using Spring 3.2 and my Spring MVC controller generate JSON data (with jackson-databind-2.2.0). I would like to customize my JSON root name with @JsonRootName (com.fasterxml.jackson.annotation.JsonRootName) annotation, however, I could not figure out how to enable it with Spring configuration.</p>
  
  <pre><code>@JsonRootName("rootNameTest")
  public class MyModel {
      private String prop;
      public String getProp() {
          return prop;
      }
      public void setProp(String prop) {
          this.prop = prop;
      }
  }
  </code></pre>
  
  <p>Here's my settings in sevlet-context.xml</p>
  
  <pre><code>&lt;bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"&gt;
      &lt;property name="order" value="1" /&gt;
      &lt;property name="contentNegotiationManager"&gt;
          &lt;bean class="org.springframework.web.accept.ContentNegotiationManager"&gt;
              &lt;constructor-arg&gt;
                  &lt;bean class="org.springframework.web.accept.ParameterContentNegotiationStrategy"&gt;
                      &lt;constructor-arg&gt;
                          &lt;map&gt;
                              &lt;entry key="json" value="application/json"/&gt;
                          &lt;/map&gt;
                      &lt;/constructor-arg&gt;
                  &lt;/bean&gt;
              &lt;/constructor-arg&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
      &lt;property name="defaultViews"&gt;
          &lt;list&gt;
              &lt;bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView"/&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Please help. Thanks.</p>