主要异常信息
org.springframework.beans.TypeMismatchException: Failed to convert property value of type ‘java.lang.String’ to required type ‘boolean’ for property ‘forceResponseEncoding’; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [utf-8]
问题
在web.xml使用字符编码过滤器中,参数值配置不当。
进入到CharacterEncodingFilter类中发现:forceRequestEncoding和forceResponseEncoding是布尔值,我写成了utf-8,所以就造成了类型转换异常
如果forceRequestEncoding为true就设置请求编码,如果forceRequestEncoding为true就设置响应编码
解决
希望能帮到你!!