Package org.zkoss.zk.ui.http

## Class RichletFilter

- java.lang.Object
- - org.zkoss.zk.ui.http.RichletFilter

- All Implemented Interfaces:
    `javax.servlet.Filter`
  Direct Known Subclasses:
    `DispatcherRichletFilter`

      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

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected boolean` | `_compress` |
    `protected javax.servlet.FilterConfig` | `_config` |
    `protected WebManager` | `_webman` |
    `protected static java.lang.String` | `RICHLET_FLAG` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RichletFilter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `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 originPath, boolean bRichlet)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _config

          protected javax.servlet.FilterConfig _config

    - #### _webman

          protected WebManager _webman

    - #### _compress

          protected boolean _compress

    - #### RICHLET_FLAG

          protected static final java.lang.String RICHLET_FLAG

  - ### 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 originPath,
                                    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`