The key to Chinese display is to identify at which stage the problem arises;
When obtaining data submitted by a jsp form:
Filter can be configured in web. xml (before struts filter must be configured)
<! -- Solve Chinese garbled characters -->
<Filter>
<Filter-name> encodingFilter </filter-name>
<Filter-class> org. springframework. web. filter. CharacterEncodingFilter </filter-class>
<Init-param>
<Param-name> encoding </param-name>
<Param-value> GBK </param-value>
</Init-param>
</Filter>
<Filter-mapping>
<Filter-name> encodingFilter </filter-name>
<Url-pattern>/* </url-pattern>
</Filter-mapping>
<! -- **************************** -->
Question about retrieving data from the mysql database:
I used mysql5.0.22. I don't know how to set the default character encoding in the command line window. Some methods on the Internet still won't work, and it won't work even after more than half a day;
Finally, I got the latest mysql 5.5.21.0 version on the official website. I created a database in workbench to create a table, set the character encoding, and finally file --> export --> forword engineer SQL create script ..
Execute the automatically generated SQL statement in the client command line window;
Success: the Chinese is displayed normally.
From the column Test_LD