1. First of all, make sure the encoding method from foreground to background
That is, configure the character encoding filter in web.xml (this filter must be before all filters)
<filter> <filter-name>characterEncoding</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>characterEncoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
2. Modify the configuration file my.ini in
the mysql installation directory and change the default-character-set=latnl latnl under [client] and [mysqld] to utf8