使用SpringMVC的@ResponseBody返回JSON串时,碰到406错误和以下提示:
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.
通常基本配置不大容易出错,在检查配置之前,先看看有没有以下两个jar包:
这俩个加入后才能正常使用。
这是jar包的链接
本文介绍了解决使用SpringMVC时遇到的406 Not Acceptable错误的方法,该错误通常出现在尝试返回JSON格式数据时。文章指出了需要引入的两个关键jar包以确保正确的响应。
1万+

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



