错误日志:
java.lang.IllegalArgumentException:
Invalid character found in the request target.
The valid characters are defined in RFC 7230 and RFC 3986
日志分析检查后发现问题得原因:
百度,查阅资料
tomcat从7.0.88开始,大多数tomcat版本都会出现此问题
解决方案:(由Apache团队建议)
Tomcat增加了安全性,不再允许在查询字符串中使用原始方括号。在请求中我们有[,](方括号),
因此服务器不处理请求,
解决方案:
修改tomcat配置文件server.xml,在Connector配置项添加以下代码
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"
relaxedQueryChars="[]|{}^\`"<>"
redirectPort="8443" />
方案理解:
请查看tomcat官方文档