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?
@RequestMapping(method=RequestMethod.GET, value="foo/bar")
@ResponseBody
public String fooBar(){
return myService.getJson();
}
The business objects are already available as JSON strings, so using MappingJacksonJsonView
is not the solution for me. @ResponseBody
is perfect, but how can I set the mimetype?