The disable-event-thread Element"

From Documentation
m
m
Line 2: Line 2:
  
 
'''Syntax:'''
 
'''Syntax:'''
  <au-decoder-class>''a_class_name''</au-decoder-class>
+
  <disable-event-thread>'''true'''|false</disable-event-thread>
  
  [Default: null (using the default JSON-based format)]
+
  [Default: true (disabled) for ZK 5 ad later; false (enabled) for ZK 2.x and 3x]
[since 5.0.4]
 
  
It specifies which class used to implement the AU decoder. The AU decoder is used to decode the AU requests. The class must implement <javadoc type="interface">org.zkoss.zk.au.AuDecoder</javadoc>.
+
It specifies whether to disable the use of the event processing thread. If disabled, no event processing thread will be used at all. In other words, all events are processed in the same thread that serves HTTP request (so called Servlet thread) directly.
  
By default, the AU request is sent in the JSON format. If you prefer to use another format, you could provide an implementation as follows.
+
For better performance (and better compatible with other frameworks), it is recommended to disable the use of the event processing thread. For more information, please refer to [[ZK Developer's Reference/UI Patterns/Event Threads|ZK Developer's Reference]].
  
#Implement <javadoc type="interface">org.zkoss.zk.au.AuDecoder</javadoc>
+
Enable the event thread only if the project does not need to integrate other frameworks (such as Spring), uses <javadoc>org.zkoss.zul.Messagebox</javadoc> and modal windows a lot, and does not have a lot of concurrent users.
#Register it by specifying it with the <code>au-decoder-class</code> element in <code>WEB-INF/zk.xml</code>
 
#Override a JavaScript method called <javadoc directory="jsdoc" method="encode(int, zk.Event, zk.Desktop)">_global_.zAu</javadoc>  to encode to the custom format
 
  
 
=Version History=
 
=Version History=

Revision as of 15:22, 4 December 2010


The disable-event-thread Element


Syntax:

<disable-event-thread>true|false</disable-event-thread>
[Default: true (disabled) for ZK 5 ad later; false (enabled) for ZK 2.x and 3x]

It specifies whether to disable the use of the event processing thread. If disabled, no event processing thread will be used at all. In other words, all events are processed in the same thread that serves HTTP request (so called Servlet thread) directly.

For better performance (and better compatible with other frameworks), it is recommended to disable the use of the event processing thread. For more information, please refer to ZK Developer's Reference.

Enable the event thread only if the project does not need to integrate other frameworks (such as Spring), uses Messagebox and modal windows a lot, and does not have a lot of concurrent users.

Version History

Last Update : 2010/12/04


Version Date Content
     



Last Update : 2010/12/04

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