Today, when the development of the problem, the memory is poor, write down the first.
1. Set up Web. XML to add Utf-8 interceptors
|
<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>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
|
2. Modify the Tomcat configuration file.
Modify the Apache-tomcat-xxx\conf\server.xml file in <connector connectiontimeout= "20000" port= "8080" protocol= "HTTP/1.1" redirectport= "8453"/> After adding usebodyencodingforuri= "true" uriencoding= "UTF-8". Add the following:
|
<connector connectiontimeout= "20000" port= "8080" protocol= "http/1.1" redirectport= "8443" useBodyEncodingForURI= " True "uriencoding=" UTF-8 "/> |
Spring MVC using jquery ajax to pass value Chinese garbled problem