1.struts action交由spring容器管理
2.spring 整合hibernate,hibernate对象交由spring管理
hibernate中 Session类的 save 和update方法:
new一个对象可以用save方法
update一个对象用updatea方法
hibernate lazy Init no Session 错误:
web中配置:[size=large][color=red](这段配置必需配置放到struts之前)[/color][/size]
<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>
2.spring 整合hibernate,hibernate对象交由spring管理
hibernate中 Session类的 save 和update方法:
new一个对象可以用save方法
update一个对象用updatea方法
hibernate lazy Init no Session 错误:
web中配置:[size=large][color=red](这段配置必需配置放到struts之前)[/color][/size]
<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>

被折叠的 条评论
为什么被折叠?



