首页 > 2018年三月

spring mvc @ResponseBody 返回JSON数据 The resource identified by…

status406

在springmvc 通过URL请求数据返回JSON时,报错 The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request “accept” headers. 问题原因为未在pom文件中引入json的转换包。 解决办法: 1、在pom.xml中添加json所需要的依赖 2、spring-mvc.xml 加入: 配置后,成功返回:   &nbsp … 阅读全文