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
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 javax.servlet.FilterConfigprotected WebManagerprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) voidinit(javax.servlet.FilterConfig config) protected booleanprocess(Session sess, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String originPath, boolean bRichlet)
-
Field Details
-
_config
protected javax.servlet.FilterConfig _config -
_webman
-
_compress
protected boolean _compress -
RICHLET_FLAG
-
-
Constructor Details
-
RichletFilter
public RichletFilter()
-
-
Method Details
-
init
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException - Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException - Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
process
protected boolean process(Session sess, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String originPath, boolean bRichlet) throws javax.servlet.ServletException, IOException - Throws:
javax.servlet.ServletExceptionIOException
-
destroy
public void destroy()- Specified by:
destroyin interfacejavax.servlet.Filter
-