springmvc獲取json Failed to load resource: the server responded with a status of 406 (Not Acceptable)

使用springmvc3.1版本時通過@ResponseBody標籤返回JSON數據的方法都報406錯: Failed to load resource: the server responded with a status of 406 (Not Acceptable) 經過調試發現少了jackson-core-asl和jackson-mapper-asl兩jar包,導入了1.9版本的jar後,問題解決了。

若get提交方式亂碼處理(一般是由於tomcat引起的,所以需要設置tomcat的編碼)

改tomcat中server.xml中的配置,加上一個 URIEncoding=”utf-8” 如下所示:

原文鏈接:https://blog.csdn.net/wangqing84411433/article/details/72814523
https://blog.csdn.net/liuxiao723846/article/details/46897319

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章