org.chwf.servlet.filter
Class CompositeFilter
java.lang.Object
|
+--org.chwf.servlet.filter.CompositeFilter
- All Implemented Interfaces:
- javax.servlet.Filter
- Direct Known Subclasses:
- CommandFilter, ViewFilter
- public class CompositeFilter
- extends java.lang.Object
- implements javax.servlet.Filter
Filter that composes a set of other filters, to simplify filter
configuration. When the composite filter is invoked, it invokes all
the composed filters in turn. When the composite filter chain is complete,
it continues with the original filter chain.
The configuration file for the composite filter is loaded from the
classpath. The file name is always ClassName-filter.xml. It
uses the same configuration as the FilterMicroContainer, but URL
patterns are ignored; all filters are always invoked.
- Author:
- Paul Strack
Method Summary |
void |
destroy()
Destroys all composite filters. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Invokes all the composite filters in order, then continues with the
original chain. |
void |
init(javax.servlet.FilterConfig config)
Initializes the composed filters, using the ClassName-filter.xml
configuration file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompositeFilter
public CompositeFilter()
init
public void init(javax.servlet.FilterConfig config)
throws javax.servlet.ServletException
- Initializes the composed filters, using the ClassName-filter.xml
configuration file.
- Specified by:
init
in interface javax.servlet.Filter
- Parameters:
config
- The filter config.- Throws:
javax.servlet.ServletException
- If composed filters cannot be initialized.
doFilter
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
- Invokes all the composite filters in order, then continues with the
original chain.
- Specified by:
doFilter
in interface javax.servlet.Filter
- Parameters:
request
- The request.response
- The response.chain
- The original filter chain.- Throws:
javax.servlet.ServletException
- For servlet errors.java.io.IOException
- For I/O errors.
destroy
public void destroy()
- Destroys all composite filters.
- Specified by:
destroy
in interface javax.servlet.Filter
Copyright © 2002-2004, Paul Strack. All Rights Reserved.