您的位置:首页 > 编程语言 > Java开发

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

2015-10-30 10:28 736 查看
解决办法 在项目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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: