标签:org.springframework. spring解决乱码 post方式解决中文乱码
<!-- Filter 定义 --> <!-- 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>
POST方式中文乱码问题 。CharacterEncodingFilter类具有encoding和forceEncoding两个属性,其中encoding是表示设置request的编码,forceEncoding表示是否同时设置response的编码。
Spring在web.xml请求中定义编码(org.springframework.web.filter.CharacterEncodingFilter)
标签:org.springframework. spring解决乱码 post方式解决中文乱码
原文地址:http://blog.csdn.net/benjamin_whx/article/details/24652033