`

ssh 整合

 
阅读更多
1.struts action交由spring容器管理

2.spring 整合hibernate,hibernate对象交由spring管理


hibernate中 Session类的 save 和update方法:
new一个对象可以用save方法
update一个对象用updatea方法


hibernate lazy Init no Session 错误:
web中配置:(这段配置必需配置放到struts之前)
<filter>
      <filter-name>openSessionInView</filter-name>
      <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
   </filter>

  <filter-mapping>
    <filter-name>openSessionInView</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics