关于SSH整合中对于Hibernate的Session关闭的问题

在web.xml的Struts2的配置上面加上

<filter>  
     <filter-name>OpenSessionInViewFilter</filter-name>  
         <filter-class>  
             org.springframework.orm.hibernate4.support.OpenSessionInViewFilter
         </filter-class>  
        <init-param>  
             <param-name>singleSession</param-name>  
             <param-value>true</param-value>  
        </init-param>  
   </filter>  
   <filter-mapping>  
       <filter-name>OpenSessionInViewFilter</filter-name>  
       <url-pattern>/*</url-pattern>  
    </filter-mapping>  
原文地址:https://www.cnblogs.com/james-roger/p/5050168.html