有一点很重要,struts的filter需要放在最底,不然action接收的中文可能会乱码,不知道是不是这个原因,反正配置了就没有乱码了,加上org.springframework.orm.hibernate3.support.OpenSessionInViewFilter就不用考虑hibernate的lazy问题了:
filter> <filter-name>encodingFilterfilter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilterfilter-class> <init-param> <param-name>encodingparam-name> <param-value>UTF-8param-value> init-param> filter> <filter-mapping> <filter-name>encodingFilterfilter-name> <url-pattern>/*url-pattern> filter-mapping> hibernateFilter org.springframework.orm.hibernate3.support.OpenSessionInViewFilter hibernateFilter /* <filter> extremetable的filter filter> <filter-mapping> extremetable的filter mapping filter-mapping> <filter> <filter-name>struts2filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcherfilter-class> filter> <filter-mapping> <filter-name>struts2filter-name> <url-pattern>/*url-pattern> filter-mapping>