org.zkoss.zk.ui.http
Class RichletFilter

java.lang.Object
  extended by org.zkoss.zk.ui.http.RichletFilter
All Implemented Interfaces:
javax.servlet.Filter

public class RichletFilter
extends java.lang.Object
implements javax.servlet.Filter

A filter used for ZK Richlet

To enable this filter, you can specify the following statement into web.xml and zk.xml. For example,


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

<filter-mapping>
        <filter-name>RichletFilter</filter-name>
        <url-pattern>/zk/*</url-pattern>
</filter-mapping>
 
In the zk.xml

<richlet>
        <richlet-name>Foo</richlet-name>
        <richlet-class>foo.FooRichlet</richlet-class>
        <init-param>
                <param-name>any</param-name>
                <param-value>any</param-value>
        </init-param>
</richlet>
<richlet-mapping>
        <richlet-name>Foo</richlet-name>
        <url-pattern>/zk/foo/*</url-pattern>
</richlet-mapping>
 
Note: The url-pattern of richlet-mapping should start with /zk in this example which is the filter-mapping mapping to.

Init parameters:

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

Since:
7.0.0
Author:
jumperchen

Constructor Summary
RichletFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
           
 void init(javax.servlet.FilterConfig config)
           
protected  boolean process(Session sess, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String path, boolean bRichlet)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RichletFilter

public RichletFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException

process

protected boolean process(Session sess,
                          javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response,
                          java.lang.String path,
                          boolean bRichlet)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo