具体报错:
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
使用的是Tomcat9,url中包含中文字符;
解决办法:
使用js中的encodeURIComponent()函数或者encodeURI函数来对url进行转义。

本文介绍在使用Tomcat9时,遇到含有中文字符的URL导致的IllegalArgumentException错误。通过使用JavaScript的encodeURIComponent()或encodeURI函数对URL进行转义,可以有效避免此问题。
具体报错:
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
使用的是Tomcat9,url中包含中文字符;
解决办法:
使用js中的encodeURIComponent()函数或者encodeURI函数来对url进行转义。

7万+
7025
3万+
1万+
1273

被折叠的 条评论
为什么被折叠?