url中不允许使用"|","{","}"等特殊的字符,若出现这些字符Tomcat将会直接返回400状态码。
1.因此需要更换一下版本的Tomcat
版本 | 地址 |
---|---|
8.5.x至8.5.12 | https://archive.apache.org/dist/tomcat/tomcat-8/ |
8.0.x至8.0.42 | https://archive.apache.org/dist/tomcat/tomcat-8/ |
7.0.x至7.0.76 | https://archive.apache.org/dist/tomcat/tomcat-7/ |
进入连接后选择你需要的版本,点击bin/,然后找到你的要运行的运行环境,点击即可下载。
2.修改tomcat配置
修改tomcat的conf文件夹下的catalina.properties文件,把文件拖到最后即可发现
#tomcat.util.http.parser.HttpParser.requestTargetAllow=|
把前面的#去点即可,若你需要使用{}等特殊符号,在|后面追加即可!