首页 > 编程语言 > 详细

Spring framework3.2整合hibernate4.1报错:No Session found for current thread

时间:2015-10-30 12:23:14      阅读:274      评论:0      收藏:0      [点我收藏+]

解决办法 在项目web.xml中配置

 

 <!-- openSessionInView配置 -->
    <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>

Spring framework3.2整合hibernate4.1报错:No Session found for current thread

原文:http://www.cnblogs.com/birkhoff/p/4922597.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!