1. 程式人生 > >org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=U

org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=U

在編寫springmvc框架中對系統傳送json資料時,通過@RequestBody註解進行對javabean轉換的時候報了個錯:

 

org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported

谷歌翻譯: org.springframework.web.HttpMediaTypeNotSupportedException:不支援內容型別'application / json; charset = UTF-8'

 

 

解決辦法:1.期初對json包進行了檢查,不用多說,它顯示無法支援,但是我再三檢查輸入型別格式,沒有錯誤,應該是缺失了jar包支援:

加入以上jar包:錯誤解決!!

 

在下邊貼上官網傳送門:https://mvnrepository.com/search?q=Jackson-annotations

不會下載的,我將jsonck打包上傳,我貼上csdn的下載連結:https://download.csdn.net/download/qq_40223688/10821591