10.8 hibernate sessionFactory关闭和html标签的应用测试
来源:互联网 发布:c 提取网页数据 编辑:程序博客网 时间:2024/06/01 07:13
Hibernate 关闭sessionFactory :
关闭sessionFactory是应在服务器被关闭,程序被卸载时关闭,所以需要写一个sessionFactory特有的监听类,当服务器被关闭时,自动关闭sessionFactory.
写个监听类 实现ServletContextListener 在该类中关闭关闭sessionFactory ,以下就是:
将监听类配置在web.xml 中
<listener>
<listener-class>cn.com.csuinfosoft.listener.HibernateListener</listener-class>
</listener>
-------------------------------------------------------------------------------------
<html:form action="完整类名"/> //这个action 的请求对应了struts-config.xml中的form-bean,那么下面直
接用一属性就可以了
<html:text property="ename"/> 这样就能显示对应得form-bean中的ename属性
html标签用于一个对应得form-bean
若是多个form组成的list,那么可以用c标签
--------------------------------------------------------------------------------------
用html标签做时,应该注意,在action中将request.setAttribute("empForm",empform);
empForm要与struts-config.xml 中配置的
<form-bean name="empForm" type="com.actionForm.empActionForm"></form-bean>
name="empForm"保持一致,否则是会报错的。
-----------------------------------------------------
加油~!/(^o^)/~
- 10.8 hibernate sessionFactory关闭和html标签的应用测试
- Hibernate创建sessionFactory,session和关闭session的工具类
- hibernate的一级缓存session和二级缓存sessionFactory应用解析
- Hibernate 关闭sessionFactory
- hibernate的sessionFactory和session
- Hibernate的SessionFactory和Session
- Hibernate下搭建JUNIT的测试环境,使用beforeclass和afterclass实现sessionFactory建立一次
- 关于Hibernate的Session和SessionFactory
- 关于Hibernate的Session和SessionFactory
- HiberNate 中 conFiguration 和 sessionFactory 的作用
- 浅谈hibernate的sessionFactory和session
- 浅谈hibernate的sessionFactory和session
- 浅谈hibernate的sessionFactory和session
- hibernate的Configuration类和SessionFactory接口
- 浅谈hibernate的sessionFactory和session
- 浅谈hibernate的sessionFactory和session
- 浅谈hibernate的sessionFactory和session
- 浅谈hibernate的sessionFactory和session
- int float double 最值
- WPF全景体验
- undefined reference to 'pthread_create'
- Ubuntu Linux下安装PHP开发环境Zend Studio 5.5.1
- WPF的结构
- 10.8 hibernate sessionFactory关闭和html标签的应用测试
- vc automation 写excel文件
- asn1c-0.9.22
- 如何销售网站上的广告位
- IoMarkIrpPending函数
- 如何pushScreen 关于窗口
- php中使用header函数的http头设置
- Win7时代
- 无线AP wep密码破解 intel 3945