原文:76. Spring Boot完美解决(406)Could not find acceptable representation原因及解决方法

原创文章 使用Spring Boot的Web项目,处理 login请求的控制器方法 该方法会返回JSON格式的数据 。此时如果访问localhost: login.html,用户期望返回jsons数据,但框架却报错: There was an unexpected error type Not Acceptable, status . Could not find acceptable repr ...

2018-06-06 10:02 0 4885 推荐指数:

查看详情

Could not find acceptable representation原因解决方法

Spring Boot:Could not find acceptable representation原因方法名跟页面、js重合了!!!解决办法:改名字,尽量不要重合。 例子: ① html的名字 showArticle.html ② js的名字 showArticle.js ...

Fri Aug 09 18:15:00 CST 2019 0 9844
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

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

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

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

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