spring返回 json报406错误

来源:互联网 发布:全球数据库市场格局 编辑:程序博客网 时间:2024/04/29 12:38
        今天改一个项目,发现一个返回json报406 The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers () 错误,查了一下发现需要该东西,以前都是能发的,算了直接用返回字符串,直接用jackson直接转换,发现json乱码,给requestMapping加上produces = "text/html;charset=UTF-8"就搞定了。
0 0