于web.xml中作如下配置:
<!-- 解决中文乱码过滤器 -->
?<filter>
??<filter-name>encodingFilter</filter-name>
??<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
??<init-param>
???<param-name>encoding</param-name>
???<param-value>UTF-8</param-value>
??</init-param>
?</filter>
?<filter-mapping>
??<filter-name>encodingFilter</filter-name>
??<url-pattern>*.do</url-pattern>
?</filter-mapping>
?
<!-- 解决Session关闭的过滤器 -->
?<filter>
??<filter-name>openSessionInView</filter-name>
??<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
?</filter>
?<filter-mapping>
??<filter-name>openSessionInView</filter-name>
??<url-pattern>*.do</url-pattern>
?</filter-mapping>
?<filter-mapping>
??<filter-name>openSessionInView</filter-name>
??<url-pattern>/dwr/*</url-pattern>
?</filter-mapping>