title: Spring MVC controller return HTML
body: <p>I am having an issue trying when trying to return HTML to my Spring MVC controller.</p>
  
  <p>It looks like this:</p>
  
  <pre><code>@RequestMapping(value = QUESTION_GROUP_CREATE_URL, method = RequestMethod.POST)
  public
  @ResponseBody
  String createQuestionGroup(@RequestBody JsonQuestionGroup questionGroup, HttpServletResponse response) {
  
      // questionGroup - this comes OK.
  
      response.setContentType("text/html");
      response.setCharacterEncoding("UTF-8");
      return "&lt;div&gt;&lt;/div&gt;";
  }
  </code></pre>
  
  <p>My Spring config:</p>
  
  <pre><code>&lt;bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean"&gt;
      &lt;property name="favorPathExtension" value="false"/&gt;
      &lt;property name="favorParameter" value="true"/&gt;
      &lt;property name="mediaTypes"&gt;
          &lt;value&gt;
              json=application/json
              xml=application/xml
              html=application/html
          &lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I am seeing firebug that response is coming like: <code>{"String":"&lt;div&gt;&lt;/div&gt;"}</code> how can I tell this method to send me plain HTML as the response?</p>