JSON数据显示在jsp页面上中文乱码的解决办法
在@RequestMapping属性添加属性produces = "text/html;charset=utf-8",设置字符集为utf-8即可
代码如下:
@RequestMapping(value = "/json",produces = "text/html;charset=utf-8")
@ResponseBody
public String getJsonList(){
List<Book> books = bookService.getBookList();
return JSON.toJSONString(books);
}

浙公网安备 33010602011771号