ZK Configuration"

From Documentation
m
m
Line 1: Line 1:
 
{{ZKDevelopersReferencePageHeader}}
 
{{ZKDevelopersReferencePageHeader}}
  
 +
=Turn on Serializable UI Factory=
 
To use ZK in a clustering environment, you have to use the serializable UI factory. It could be done by specifying the following statement in <tt>WEB-INF/zk.xml</tt>:
 
To use ZK in a clustering environment, you have to use the serializable UI factory. It could be done by specifying the following statement in <tt>WEB-INF/zk.xml</tt>:
  
Line 14: Line 15:
  
 
Also notice that you cannot enable the use of the event thread<ref>The reason is that the event thread might be suspended. Unfortunately, the thread cannot be migrated from one machine to another.</ref>. It is disabled by default. For more information, please refer to the [[ZK Developer's Reference/UI Patterns/Event Threads|Event Threads]] section.
 
Also notice that you cannot enable the use of the event thread<ref>The reason is that the event thread might be suspended. Unfortunately, the thread cannot be migrated from one machine to another.</ref>. It is disabled by default. For more information, please refer to the [[ZK Developer's Reference/UI Patterns/Event Threads|Event Threads]] section.
 +
 +
<blockquote>
 +
----
 +
<references/>
 +
</blockquote>
 +
 +
=Turn on Log=
 +
 +
If an attribute or a listener is not serializable, ZK will skip it, i.e., not to serialize it (similar to how a Servlet container serializes the attributes of sessions). It is sometimes hard to know what are ignored, since it is common for a developer to forget to declare a value or a listener as serializable.
 +
 +
To detect this problem, you could turn on the log for <tt>org.zkoss.io.serializable</tt> to the DEBUG level<ref>Available in 5.0.7</ref>.
  
 
<blockquote>
 
<blockquote>
Line 25: Line 37:
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-
| &nbsp;
+
| 5.0.7
| &nbsp;
+
| April 2011
| &nbsp;
+
| The log called <tt>org.zkoss.io.serializable</tt> was introduced.
 
|}
 
|}
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Revision as of 01:10, 29 April 2011


ZK Configuration


Turn on Serializable UI Factory

To use ZK in a clustering environment, you have to use the serializable UI factory. It could be done by specifying the following statement in WEB-INF/zk.xml:

<zk>
	<system-config>
		<ui-factory-class>org.zkoss.zk.ui.http.SerializableUiFactory</ui-factory-class>
	</system-config>
</zk>

SerializableUiFactory is the UI factory that will instantiate serializable sessions such that the sessions, components, pages and desktops will be serialized when a session is about to deactivate.

Also notice that you cannot enable the use of the event thread[1]. It is disabled by default. For more information, please refer to the Event Threads section.


  1. The reason is that the event thread might be suspended. Unfortunately, the thread cannot be migrated from one machine to another.

Turn on Log

If an attribute or a listener is not serializable, ZK will skip it, i.e., not to serialize it (similar to how a Servlet container serializes the attributes of sessions). It is sometimes hard to know what are ignored, since it is common for a developer to forget to declare a value or a listener as serializable.

To detect this problem, you could turn on the log for org.zkoss.io.serializable to the DEBUG level[1].


  1. Available in 5.0.7

Version History

Last Update : 2011/04/29


Version Date Content
5.0.7 April 2011 The log called org.zkoss.io.serializable was introduced.



Last Update : 2011/04/29

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