Through the source can be seen in the Web. XML configuration Characterencodingfilter, you can configure two parameters: Encoding and forceencoding;
Encoding: encoding format;
Forceencoding: Whether the set of encoding is allowed to overwrite encodings that already exists in request and response.
How to use:
1 <filter> 2 <filter-name>characterEncodingFilter</filter-name> 3 <filter-class >org.springframework.web.filter.CharacterEncodingFilter</filter-class> 4 <init-param> 5 <param-name>encoding</param-name> 6 <param-value>UTF-8</param-value> 7 </ Init-param> 8 <init-param> 9 <param-name>forceencoding</param-name>10 < Param-value>true</param-value>11 </init-param>12 </filter>13 < filter-mapping>14 <filter-name>characterencodingfilter</filter-name>15 < Url-pattern>/*</url-pattern>16 </filter-mapping>
characterencodingfilter-spring Character encoding Filter