May 23, 2011
jsp page struts2 in action mysql Chinese garbled address:
page <% @ page language = "java" import = "java.util .* "pageEncoding =" GBK "%> must remember the form of the method is” post “

struts configuration
mysql installation would require the selected encoding, select the GBK.
(the first layer through which the test analysis problems, and then find appropriate solutions, such as the page has been read java code is garbled, it is likely that struts not properly passed by value, need to modify the struts configuration and page-related properties.)

with:
jsp which garbled the first question that can be achieved by converting the character set
is the String after = new String (before.getByts (“ios-8859- 1 “,” gb2312 “);
in the mysql among the garbage
1. in the establishment of a database, be sure to select the default character set gbk
2. establish a database connection when using the following method “jdbc: mysql: / / localhost / secondhandbook? user = root