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