您的位置:首页 > 运维架构

OpenSessionInViewFilter的配置

2016-03-24 13:53 417 查看
<pre name="code" class="html"><pre name="code" class="html">OpenSessionInViewFilter是一个不错的解决因hiberante session 关闭 而懒加载不能正常使用的方法



<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:web_spring.xml</param-value>
</context-param>
<filter>
<filter-name>openSession</filter-name>
<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>

</filter>
<filter-mapping>
<filter-name>openSession</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: