原文: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