xml文件配置信息spring
<filter> <filter-name>openSessionInView</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>sessionFactoryBeanName</param-name> <param-value>sf</param-value> </init-param> </filter> <filter-mapping> <filter-name>openSessionInView</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
若是sessionFactory在spring中的配置不是sessionFactory這個名稱,能夠經過上面的配置解決。 指定sessionFactoryBeanName爲你配置的sessionFactorysession