ZK Filter"

From Documentation
Line 25: Line 25:
 
It specifies the default charset for the output of this filter.
 
It specifies the default charset for the output of this filter.
  
If an empty string is specified as follows, the container's default is used. In other words, the <tt>setCharacterEncoding</tt> method of <tt>javax.servlet.ServletResponse</tt> is not called.
+
If an empty string is specified as follows, the container's default is used. In other words, the <tt>setCharacterEncoding</tt> method of <javadoc>javax.servlet.ServletResponse</javadoc> is not called.
  
 
  <param-value></param-value>
 
  <param-value></param-value>

Revision as of 06:20, 9 July 2010

[Optional] Class: DHtmlLayoutFilter

DHtmlLayoutFilter is a filter to post-process the output generated by other servlets, such as JSP pages. Its role is similar to the ZK Loader. Unlike the ZK Loader, which loads static ZUML pages from Web applications directly, the ZK filter is designed to process dynamic pages generated by other servlets, say JSP or JSF. It enables developers to add rich user interfaces to existent servlets written in any technology.

Note: the output must be in XHTML (or ZUML) syntax. If you encounter any problem, you can save the generated output into a ZHTML page and then browse the URL whether the ZHTML page is stored.

The Initial Parameters

init-param
Descriptions
extension [Optional][Default: html]

It specifies how to process the response generated by other servlets.

If html or zhtml, XHTML is assumed to be the default namespace. If xul or zul, XUL is assumed to be the default namespace.

charset [Optional][Default: UTF-8]

It specifies the default charset for the output of this filter.

If an empty string is specified as follows, the container's default is used. In other words, the setCharacterEncoding method of ServletResponse is not called.

<param-value></param-value>
compress [Optional][Default: true]

It specifies whether to compress the output if the browser supports the compression (Accept-Encoding) and this filter is not included by other Servlets.

How to Specify in web.xml

 <filter>
     <filter-name>zkFilter</filter-name>
     <filter-class>org.zkoss.zk.ui.http.DHtmlLayoutFilter</filter-class>
 </filter>