There is a clean way to return string as json in a Spring Web API?
问题 For example, I had to implement as below: @RequestMapping(value = "/get-string", method = {RequestMethod.GET}) public @ResponseBody String getString() { return "Hello World!"; } When the action is called by Ajax in a JS file, the response received is: HelloWorld . So, if the Ajax request is configured to only receive json encoded responses, I receive the standard deconding error. To solve this problem in server-side, I need to receive "HelloWorld" . My question is: There is a clean way I can