使用Struts的PlugIn技术把HibernateSessionFactory,具体过程如下:
(1)创建HibernateSessionFactory.java,代码如下:
package zy.pro.td.util; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Session; import net.sf.hibernate.cfg.Configuration; /** * Configures and provides access to Hibernate sessions, tied to the * current thread of execution. Follows the Thread Local Session * pattern, see {@link http://hibernate...[ 查看全文 ]