修改Tomcat,添加URLEncoding时报错解决办法

来源:互联网 发布:时差查询换算器 软件 编辑:程序博客网 时间:2024/04/29 06:33

以前使用的Tomcat的版本是6.0.26,换成了新版本6.0.36。按照以前的设置,在server.xml文件中添加URLEncoding="GBK"时,启动后报错了。报错信息如下:

2012-12-13 9:09:33 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'URLEncoding' to 'GBK' did not find a matching property.

从网上搜了一下给的解决方法很简单,修改server.xml中的protocol就可以了

修改前:

<Connector port="8080"protocol="HTTP/1.1" connectionTimeout="20000"  redirectPort="8443" URLEncoding="GBK"/>

修改后:

<Connector port="8080"protocol="org.apache.coyote.http11.Http11Protocol"  connectionTimeout="20000"  redirectPort="8443" URLEncoding="GBK"/>

重新启动Tomcat就可以了。