錯誤日誌:
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官方文檔