1)加过滤器
response.setCharacterEncoding(“UTF-8”);
request.setCharacterEncoding(“UTF-8”); 只对post方式提交的数据有用
2)tomcat server.xml
URIEncoding=”utf-8″
3)jdbc:mysql://127.0.0.1:3306/book?useUnicode=true&characterEncoding=utf8
4)my.cnf
default-character-set=utf8