[java]代码库
1.检查了web.xml中已经增加了过滤中文编码
<!-- Character Encoding filter -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
2.检查容器tomcat,修改tomcat的conf/server.xml中的
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" useBodyEncodingForURI="true" URIEncoding="UTF-8" />
在Connector标签加上useBodyEncodingForURI="true" URIEncoding="UTF-8" 就可以了
初级程序员
by: qwasgh 发表于:2019-12-20 22:07:27 顶(1) | 踩(1) 回复
66666666666
回复评论