首先,mysql安装的时候注意,设置一定要把latin1改成utf-8,后来改可能是没用的,项目里。web.xml也要注意设置。eclispse编译环境也得是utf-8,持久层,也就是hibernate的配置有个地方要改。
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/ad?useUnicode=true&characterEncoding=utf-8</property>