title: Spring Controller Content-Type
body: <p>I've defined a controller (see below), and specified that it produces JSON, however when requesting (using curl), a <code>Content-Type</code> of <code>text/html</code> is returned. I can override this by setting the header on the <code>HttpServletResponse</code> directly, but I wasn't sure if this was expected behavior, and if so, if what I am doing is the correct workaround.</p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/test", produces = MediaType.APPLICATION_JSON_VALUE)
  public class Test { 
  
      @RequestMapping(value = "/home", method = RequestMethod.GET)
      public String home(final Model model, final HttpServletRequest request, final HttpServletResponse response) {
  
          return "some/freemarker/template/path";
  
      } 
  
  }
  </code></pre>
  
  <p><code>Content-Type: text/html;charset=UTF-8</code></p>
  
  <p><strong>Update:</strong></p>
  
  <p>I should add that I am using Freemarker as the view technology.</p>