原文:org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation

异常 原因之一 自我感觉 设定的response的contentType同实际controller层返回的对象类型不一致。 注意点 ResponseBody 需存在,才可复现。 可以在Controller Class上,如果不存在,会直接走视图解析器 produces定义了 contentType为application octet stream,实际返回了true produces 用于指定re ...

2019-01-04 17:44 0 7316 推荐指数:

查看详情

Could not find acceptable representation

引起的原因: 由于设置了@ResponseBody,要把对象转换成json格式,缺少转换依赖的jar包,故此错。 解决办法: 加入依赖的jar,jackson-core ...

Tue Aug 05 06:11:00 CST 2014 1 22116
Could not find acceptable representation

报了一个这个异常: 通过这篇文章找到了“favorPathExtension”关键字, Spring Boot完美解决(406)Could not find acceptable representation原因及解决方法 进而找到了这篇文章中的方法,解决了问题 SpringMVC ...

Tue Jan 23 04:31:00 CST 2018 0 1293
Could not find acceptable representation报错

网上其他人说: 方法名跟页面、js重合了 我这边发现问题在于 后台数据返回给前端两次 如果不是因为后台debug没结束,然后前端已经拿到数据,很难发现 ...

Tue Sep 29 00:37:00 CST 2020 0 660
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM