<!--配置过滤器-->
<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>
通过过滤器的方式进行配置
控制台总乱码
就是tomcat的服务器输出的事情,要去tomcat文件夹下config中的logging.properties,寻找Encoding选项,把后面的值换成GBK