在使用以下参数配置Hibernate之后,我找到了答案:
<property name="hibernate.connection.CharSet">utf8</property><property name="hibernate.connection.characterEncoding">utf8</property><property name="hibernate.connection.useUnipre">true</property>
我们还必须在web.xml中使用以下参数将Spring配置为UTF-8:
<filter> <filter-name>SetCharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param></filter><filter-mapping> <filter-name>SetCharacterEncodingFilter</filter-name> <url-pattern>*</url-pattern></filter-mapping>
而且有效!谢谢大家



