title: In Spring MVC, how can I set the mime type header when using @ResponseBody
body: <p>I have a Spring MVC Controller that returns a JSON String and I would like to set the mimetype to application/json. How can I do that?</p>
  
  <pre><code>@RequestMapping(method=RequestMethod.GET, value="foo/bar")
  @ResponseBody
  public String fooBar(){
      return myService.getJson();
  }
  </code></pre>
  
  <p>The business objects are already available as JSON strings, so using <code>MappingJacksonJsonView</code> is not the solution for me. <code>@ResponseBody</code> is perfect, but how can I set the mimetype?</p>