ZK AU Engine"

From Documentation
m
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{ZKConfigurationReferencePageHeader}}
 
{{ZKConfigurationReferencePageHeader}}
  
 +
=DHtmlUpdateServlet=
 
  [Required] Class: <javadoc>org.zkoss.zk.au.http.DHtmlUpdateServlet</javadoc>
 
  [Required] Class: <javadoc>org.zkoss.zk.au.http.DHtmlUpdateServlet</javadoc>
  
  
<tt>DHtmlUpdateServlet</tt> is a servlet that handles AJAX requests asynchronously and automatically.
+
ZK AU Engine, aka., ZK Update Engine, is a servlet that handles AJAX requests asynchronously and automatically.
  
Notice that the URL pattern mapped to this engine must be consistent with the <tt>update-uri</tt> parameter of the ZK Loader.
+
Notice that the URL pattern mapped to this engine must be consistent with the <code>update-uri</code> parameter of [[ZK_Configuration_Reference/web.xml/ZK_Loader|ZK Loader]].
  
=== The Initial Parameters ===
+
Here is [[ZK_Configuration_Reference/web.xml/Sample_of_web.xml|a complete sample]].
  
{| border="1"
+
= The Initial Parameters =
 +
 
 +
{| class='wikitable'
 
! <center>init-param</center>
 
! <center>init-param</center>
 
! <center>Descriptions</center>
 
! <center>Descriptions</center>
Line 16: Line 19:
 
|-
 
|-
 
|  compress
 
|  compress
|  [Optional][Default:<tt>true</tt>][since 3.6.3]
+
|  [Optional][Default:<code>true</code>]{{versionSince|3.6.3}}
  
  
It specifies whether to compress the output of this Servlet, if the browser supports the compression (<tt>Accept-Encoding</tt>). Notice that it affects no only the AU response, but also JavaScript and CSS files loaded from this Servlet.
+
It specifies whether to compress the output of this Servlet, if the browser supports the compression (<code>Accept-Encoding</code>). Notice that it affects not only the AU response, but also JavaScript and CSS files loaded from this Servlet.
 +
 
 +
<source lang="xml" >
 +
<init-param>
 +
<param-name>compress</param-name>
 +
<param-value>false</param-value>
 +
</init-param>
 +
</source>
  
 
|-
 
|-
Line 29: Line 39:
  
 
...
 
...
| [Optional] [since 5.0]
+
| [Optional]{{versionSince|5.0}}
  
It specifies an AU extension The first processor must be specified with the name called <tt>extension0</tt>, second <tt>extension1</tt> and so on.
+
It specifies an AU extension The first processor must be specified with the name called <code>extension0</code>, second <code>extension1</code> and so on.
  
 
The syntax of the value is
 
The syntax of the value is
Line 52: Line 62:
 
   
 
   
 
The class must implement the <javadoc type="interface">org.zkoss.zk.au.http.AuExtension</javadoc> interface.
 
The class must implement the <javadoc type="interface">org.zkoss.zk.au.http.AuExtension</javadoc> interface.
 +
|}
  
|-
+
=Map URL to ZK AU Engine=
|  processor0
 
processor1
 
  
processor2
+
Mapping URL to ZK AU Engine is straightforward:
  
...
+
<source lang="xml">
| [Optional] (deprecated since 5.0)
+
<servlet>
 +
<servlet-name>auEngine</servlet-name>
 +
<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
 +
</servlet>
 +
<servlet-mapping>
 +
<servlet-name>auEngine</servlet-name>
 +
<url-pattern>/zkau/*</url-pattern>
 +
</servlet-mapping>
 +
</source>
  
It specifies an AU processor. The first processor must be specified with the name called <tt>processor0</tt>, second <tt>processor1</tt> and so on.
+
Notice that the URL pattern mapped to this engine must be consistent with the <code>update-uri</code> parameter of [[ZK_Configuration_Reference/web.xml/ZK_Loader|ZK Loader]].
  
The syntax of the value is
+
Here is [[ZK_Configuration_Reference/web.xml/Sample_of_web.xml|a complete sample]].
  
/prefix=class
+
=Version History=
 
 
For example,
 
 
 
<source lang="xml" >
 
<init-param>
 
<param-name>processor0</param-name>
 
<param-value>/upload=com.super.MyUploader</param-value>
 
</init-param>
 
<init-param>
 
<param-name>processor1</param-name>
 
<param-value>/extra=com.super.MyExtra</param-value>
 
</init-param>
 
</source>
 
 
 
The class must implement the <javadoc type="interface">org.zkoss.zk.au.http.AuProcessor</javadoc> interface.
 
  
 +
{| border='1px' | width="100%"
 +
! Version !! Date !! Content
 +
|-
 +
| 5.0.0
 +
| 07/14/10
 +
| processor0, processor1, processor2 parameters have been depreciated.
 
|}
 
|}
  
 
{{ZKConfigurationReferencePageFooter}}
 
{{ZKConfigurationReferencePageFooter}}

Latest revision as of 01:52, 11 May 2022


DHtmlUpdateServlet

[Required] Class: DHtmlUpdateServlet


ZK AU Engine, aka., ZK Update Engine, is a servlet that handles AJAX requests asynchronously and automatically.

Notice that the URL pattern mapped to this engine must be consistent with the update-uri parameter of ZK Loader.

Here is a complete sample.

The Initial Parameters

init-param
Descriptions
compress [Optional][Default:true]Since 3.6.3


It specifies whether to compress the output of this Servlet, if the browser supports the compression (Accept-Encoding). Notice that it affects not only the AU response, but also JavaScript and CSS files loaded from this Servlet.

<init-param>
	<param-name>compress</param-name>
	<param-value>false</param-value>
</init-param>
extension0

extension1

extension2

...

[Optional]Since 5.0

It specifies an AU extension The first processor must be specified with the name called extension0, second extension1 and so on.

The syntax of the value is

/prefix=class

For example,

<init-param>
	<param-name>extension0</param-name>
	<param-value>/upload=com.super.MyUploader</param-value>
</init-param>
<init-param>
	<param-name>extension1</param-name>
	<param-value>/extra=com.super.MyExtra</param-value>
</init-param>


The class must implement the AuExtension interface.

Map URL to ZK AU Engine

Mapping URL to ZK AU Engine is straightforward:

	<servlet>
		<servlet-name>auEngine</servlet-name>
		<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>auEngine</servlet-name>
		<url-pattern>/zkau/*</url-pattern>
	</servlet-mapping>

Notice that the URL pattern mapped to this engine must be consistent with the update-uri parameter of ZK Loader.

Here is a complete sample.

Version History

Version Date Content
5.0.0 07/14/10 processor0, processor1, processor2 parameters have been depreciated.



Last Update : 2022/05/11

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