Package org.zkoss.zk.ui.http
Class RichletFilter
java.lang.Object
org.zkoss.zk.ui.http.RichletFilter
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected jakarta.servlet.FilterConfigprotected WebManagerprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) voidinit(jakarta.servlet.FilterConfig config) protected booleanprocess(Session sess, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String originPath, boolean bRichlet)
-
Field Details
-
_config
protected jakarta.servlet.FilterConfig _config -
_webman
-
_compress
protected boolean _compress -
RICHLET_FLAG
-
-
Constructor Details
-
RichletFilter
public RichletFilter()
-
-
Method Details
-
init
public void init(jakarta.servlet.FilterConfig config) throws jakarta.servlet.ServletException - Specified by:
initin interfacejakarta.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:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.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.ServletExceptionIOException
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Filter
-