Invalid character found in the request target.
invalid in The found request Target character
2023-09-27 14:25:11 时间
背景:springboot项目内置tomcat9.0
调用的接口中有{}就会报错
解决办法:
新的tomcat新版本增加了一个新特性,就是严格按照 RFC 3986规范进行访问解析,而 RFC 3986规范定义了Url中只允许包含英文字母(a-zA-Z)、数字(0-9)、-_.~4个特殊字符以及所有保留字符(RFC3986中指定了以下字符为保留字符:! * ’ ( ) ; : @ & = + $ , / ? # [ ])。
由于请求中包含了特殊的保留字符,所以tomcat无法正确解析请求参数,导致出错。
解决方法:
1.降低tomcat的版本。
2.采用最新tomcat版本。对请求链接进行编码,并修改对应的过滤器,对所有请求链接进行编码解析处理。
参考资料:
1.tomcat升级后报错: Invalid character found in the request target.
相关文章
- org.aspectj.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
- java.lang.IllegalStateException: The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid state for called method 解决办法
- Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 18
- MyBatis绑定错误[Invalid bound statement (not found)]
- PL/SQL连接错误:ora-12705:cannot access NLS data files or invalid environment specified
- mysql Invalid default value for 'time'
- qt invalid use of incomplete type class QDebug
- PostgreSQL copy 时提示:ERROR: invalid byte sequence for encoding "UTF8": 0xb3
- MyEclipse对Struts2配置文件较检异常 Invalid result location value/parameter
- [Issue Fixed]-执行脚本时出现invalid option错误
- eclipse之The currrently displayed page contains invalid values错误
- 解决Invalid bound statement (not found)(Mybatis的Mapper绑定问题)