乱码我们或许经常遇到,一般的做法我们都是统一编码
如何在springmvc中解决post乱码那,在webxml中加入
<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>
要加在springmvc的拦截器前面,因为拦截器有先后顺序。