public class ConditionalDelegatingFilter
extends java.lang.Object
implements javax.servlet.Filter
The following snippet from a web.xml file would invoke the
com.target.filter
filter if it exists. The target
filter would have access to its someTargetParameter
value.
<filter> <filter-name>MyFilterService</filter-name> <filter-class>atg.filter.ConditionalDelegatingFilter</filter-class> <init-param> <param-name>targetFilter</param-name> <param-value>com.target.filter</param-value> </init-param> <init-param> <param-name>someTargetParameter</param-name> <param-value>someValue</param-value> </init-param> </filter>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_NAME_PARAMETER_NAME |
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
FILTER_CLASS_NAME |
protected javax.servlet.Filter |
mTarget |
Constructor and Description |
---|
ConditionalDelegatingFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called by the web container to indicate to a filter that
it is being taken out of service
|
void |
doFilter(javax.servlet.ServletRequest pRequest,
javax.servlet.ServletResponse pResponse,
javax.servlet.FilterChain pFilterChain)
Called by the web container to indicate that a filter should
filter a request/response
|
void |
init(javax.servlet.FilterConfig pFilterConfig)
Called by the web container to indicate to a filter that
it is being placed into service.
|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String FILTER_CLASS_NAME
public static final java.lang.String CLASS_NAME_PARAMETER_NAME
protected javax.servlet.Filter mTarget
public void doFilter(javax.servlet.ServletRequest pRequest, javax.servlet.ServletResponse pResponse, javax.servlet.FilterChain pFilterChain) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
pRequest
- the servlet requestpServletResponse
- the servlet responsepFilterChain
- the filter chainjava.io.IOException
- if an i/o error occursjavax.servlet.ServletException
- if an error occurs when processing this filterpublic void init(javax.servlet.FilterConfig pFilterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
pFilterConfig
- filter configuration informationjavax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter