| |
|
| java.lang.Object org.apache.maven.cactus.sample.SampleFilter
SampleFilter | public class SampleFilter implements Filter(Code) | | Sample filter that implements some very simple business logic. The goal is
to provide some functional tests for Cactus and examples for Cactus users.
This filter simply adds a header and a footer to the returned HTML.
version: $Id: SampleFilter.java 238815 2004-02-29 16:34:44Z vmassol $ |
addFooter | protected void addFooter(OutputStream theOutputStream) throws IOException(Code) | | Write the footer to the output stream. The footer text is extracted
from a filter initialisation parameter (defined in
web.xml ). Don't write anything if no parameter is defined.
Parameters: theOutputStream - the output stream exception: IOException - on failure |
addHeader | protected void addHeader(OutputStream theOutputStream) throws IOException(Code) | | Write the header to the output stream. The header text is extracted
from a filter initialisation parameter (defined in
web.xml ). Don't write anything if no parameter is defined.
Parameters: theOutputStream - the output stream exception: IOException - on failure |
destroy | public void destroy()(Code) | | Filter un-initialisation. Called by the servlet engine during the life
cycle of the filter.
|
doFilter | public void doFilter(ServletRequest theRequest, ServletResponse theResponse, FilterChain theChain) throws IOException, ServletException(Code) | | Perform the filter function. Called by the container upon a request
matching the filter pattern defined in web.xml .
Parameters: theRequest - the incmoing HTTP request Parameters: theResponse - the returned HTTP response Parameters: theChain - the chain of filters extracted from the definitiongiven in web.xml by the container. exception: ServletException - on failure exception: IOException - on failure |
|
|
|