I have a controller mapped with the following annotation:
@RequestMapping(value = \"/json\", method = RequestMethod.GET, produces = \"application/json\")
@Re
As other people have commented, because the return type of your method is String
Spring won't feel need to do anything with the result.
If you change your signature so that the return type is something that needs marshalling, that should help:
@RequestMapping(value = "/json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public Map bar() {
HashMap map = new HashMap();
map.put("test", "jsonRestExample");
return map;
}