编码问题
浏览器默认utf-8编码
服务器端iso-8859-1
request.setCharacterEncoding("utf-8");
麻烦每一个请求都得添加
故可以用servlet过滤器(post请求)
<!-- spring提供编码过滤器-->
<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>