Configuring the ZK Configuration File

From Documentation
Revision as of 04:18, 19 July 2010 by Char (talk | contribs) (Created page with ' {{ZKDevelopersGuidePageHeader}} To make ZK works with Hibernate smoothly, you have to use the following utilities. # Create <tt>zk.xml</tt> under <tt>$myApp/WEB-INF/</tt>(if n…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Configuring the ZK Configuration File


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


To make ZK works with Hibernate smoothly, you have to use the following utilities.

  1. Create zk.xml under $myApp/WEB-INF/(if not exists)
  2. Copy the following lines into your zk.xml
 <!-- Hibernate SessionFactory lifecycle -->
 <listener>
 <description>Hibernate SessionFactory lifecycle</description>
 <listener-class>org.zkoss.zkplus.hibernate.HibernateSessionFactoryListener</listener-class>
 </listener>

 <!-- Hibernate OpenSessionInView Pattern -->
 <listener>
 <description>Hibernate Open Session In View life-cycle</description>
 <listener-class>org.zkoss.zkplus.hibernate.OpenSessionInViewListener</listener-class>
 </listener>

 <!-- Hibernate thread session context handler -->
 <listener>
 <description>Hibernate thread session context handler</description>
 <listener-class>org.zkoss.zkplus.hibernate.HibernateSessionContextListener</listener-class>
 </listener>

$myApp represents the name of your web application. ex. event



Last Update : 2010/07/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.