标签:val enc color tomcat7 post map char get请求 spring
get请求:-Dmaven.tomcat.uriEncoding=UTF-8 tomcat7:run 解决get请求中文乱码
post请求:在WEB-INFO下web.xml里添加如下过滤器代码
<filter>
<filter-name>CharacterEncodingFilter</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>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
标签:val enc color tomcat7 post map char get请求 spring
原文地址:https://www.cnblogs.com/-217/p/14327681.html