Configuring the ZK Configuration File"

From Documentation
(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…')
 
m (correct highlight (via JWB))
 
Line 4: Line 4:
 
To make ZK works with Hibernate smoothly, you have to use the following utilities.
 
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 not exists)
+
# Create <code>zk.xml</code> under <code>$myApp/WEB-INF/</code>(if not exists)
# Copy the following lines into your <tt>zk.xml</tt>
+
# Copy the following lines into your <code>zk.xml</code>
  
 
<source lang="xml" >
 
<source lang="xml" >
Line 27: Line 27:
 
</source>
 
</source>
  
<tt>$myApp</tt> represents the name of your web application. ex.  <tt>event</tt>
+
<code>$myApp</code> represents the name of your web application. ex.  <code>event</code>
  
 
{{ ZKDevelopersGuidePageFooter}}
 
{{ ZKDevelopersGuidePageFooter}}

Latest revision as of 10:38, 19 January 2022


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 : 2022/01/19

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