Class RichletFilter

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

public class RichletFilter extends Object implements jakarta.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
     
    protected jakarta.servlet.FilterConfig
     
    protected WebManager
     
    protected static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain)
     
    void
    init(jakarta.servlet.FilterConfig config)
     
    protected boolean
    process(Session sess, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String originPath, boolean bRichlet)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _config

      protected jakarta.servlet.FilterConfig _config
    • _webman

      protected WebManager _webman
    • _compress

      protected boolean _compress
    • RICHLET_FLAG

      protected static final String RICHLET_FLAG
  • Constructor Details

    • RichletFilter

      public RichletFilter()
  • Method Details

    • init

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

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

      protected boolean process(Session sess, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String originPath, boolean bRichlet) throws jakarta.servlet.ServletException, IOException
      Throws:
      jakarta.servlet.ServletException
      IOException
    • destroy

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