很简单,我的做法是在@RequestMapping中添加produces = "application/json; charset=utf-8"
请看如下代码:
@RequestMapping(value="selectAll",method=RequestMethod.GET,produces = "application/json; charset=utf-8")
@ResponseBody
public String selectAll(){
List<Dwxx> dwxxs = dwxxService.selectAll();
JSONObject jsonObject = new JSONObject();
jsonObject.put("dwxxs", dwxxs);
jsonObject.put("success", true);
return JSON.toJSONString(jsonObject);
}
介绍了一种做法,即在@RequestMapping中添加produces = \application/json; charset=utf-8\,但未提及具体解决的问题。
473

被折叠的 条评论
为什么被折叠?



