java.lang.IllegalArgumentException: Invalid character found in the request target. The valid charact
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
说明:
项目换了高版本的Tomcat之后出现这个错误
这个错误是因为高版本的Tomcat对URL参数中的特殊字符进行了严格限制
在网上有很多种解决方案:
1:更换低版本的Tomcat
2:修改Tomcat中conf中的catalina.properties文件
等等
我的解决方案:
对URL进行js encodeURI编码
var url = encodeURI(urlPath);
替换服务器页面文件,问题解决;
还没有评论,来说两句吧...