Tomcat报错:The valid characters are defined in RFC 7230 and RFC 3986

Posted digdeep

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Tomcat报错:The valid characters are defined in RFC 7230 and RFC 3986相关的知识,希望对你有一定的参考价值。

Tomcat报错:The valid characters are defined in RFC 7230 and RFC 3986

原因是有个请求:

/loadxxxx.json?userid=xxx&comparestr={"aaa":"3623","bbb","isqf":"0"}&bbb=custominfo1
包含了特殊字符: { 和 }
解决方法:
1、使用 encodeURICompoment对参数进行编码;
2、在conf/catalina.properties中最后添加2行:
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{},
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

3、使用post提交,不用把参数放到url中;

 

以上是关于Tomcat报错:The valid characters are defined in RFC 7230 and RFC 3986的主要内容,如果未能解决你的问题,请参考以下文章

The valid characters are defined in RFC 7230 and RFC 3986报错处理

The valid characters are defined in RFC 7230 and RFC 3986报错处理

Springboot 报错 Invalid character found in the request target. The valid characters are defined in RFC

springboot 内置默认启动tomcat容器遇到The valid characters are defined in RFC 7230 and RFC 3986”

tomcat:The selected directory in not a valid Tomcat home

异常:The temporary upload location [/tmp/tomcat.135042057.80/work/Tomcat/localhost/ROOT] is not valid(