Java : Character decoding failed.


信息 :org.apache.tomcat.util.http.Parameters [DirectJDKLog.java : 173] Character decoding failed. Parameter [param] with value [] has been ignored. Note that the name and value quoted here may be corrupted due to the failed decoding. Use debug level logging to see the original, non-corrupted values.
Note: further occurrences of Parameter errors will be logged at DEBUG level.

原因 :http接口請求,攜帶參數中含有%, 編碼出錯,導致數據傳輸為空。

解決 :param.replaceAll("%" , "%25");

補充 :

1.當發送參數數據類型為 "Content-Type", "application/x-www-form-urlencoded" 會出現此問題
2.當發送參數類型為 "Content-Type", "application/json" 接口使用@RequestBody接收入參 可以避免

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM