GET protocol submitted in Chinese garbled:
The URL parameter, which is parsed at the tomcat level, requires setting the uriencoding parameter to Utf-8.
Locate the Server.xml file (typically in/etc/tomcat6/server.xml) and modify it to:
<ConnectorPort= "8080"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "8443"uriencoding= "Utf-8"/><ConnectorPort= "8009"Protocol= "ajp/1.3"Redirectport= "8443"uriencoding= "Utf-8"/>
PS: If you use Apache to proxy through the AJP protocol, you also need to modify the configuration of AJP to UTF, see the example above.
POST protocol submitted in Chinese garbled:
If the data is post, the decoding work is handled by the SPRINGMVC code.
Find your project's Web. xml file, set the decoder parameters, can generally be:
<Filter> <Filter-name>Encoding</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>Encoding</Filter-name> <Url-pattern>/*</Url-pattern></filter-mapping>