tomcat7中文字符编码问题

关于一次tomcat URI中文编码问题处理
异常:
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
(中文参数的uri tomcat无法进行转义)


解决方法:

1.修改tomcat配置文件server.xml,在Connector配置项添加relaxedQueryChars属性
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"
relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
redirectPort="8443" />
2.降低tomcat版本,比如tomcat6.0.29

这里是引用 https://bbs.csdn.net/topics/392292638

tomcat7官方配置属性详解

tomcat7属性官方配置详解

猜你喜欢

转载自blog.csdn.net/javaxiao____/article/details/84984756