Save This Page
Home » cactus-1.8.0-src » org.apache.cactus.sample.servlet » [javadoc | source]
org.apache.cactus.sample.servlet
public class: SampleFilter [javadoc | source]
java.lang.Object
   org.apache.cactus.sample.servlet.SampleFilter

All Implemented Interfaces:
    Filter

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.
Method from org.apache.cactus.sample.servlet.SampleFilter Summary:
addFooter,   addHeader,   destroy,   doFilter,   init
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cactus.sample.servlet.SampleFilter Detail:
 protected  void addFooter(OutputStream theOutputStream) throws IOException 
    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.
 protected  void addHeader(OutputStream theOutputStream) throws IOException 
    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.
 public  void destroy() 
    Filter un-initialisation. Called by the servlet engine during the life cycle of the filter.
 public  void doFilter(ServletRequest theRequest,
    ServletResponse theResponse,
    FilterChain theChain) throws IOException, ServletException 
    Perform the filter function. Called by the container upon a request matching the filter pattern defined in web.xml.
 public  void init(FilterConfig theConfig) throws ServletException 
    Filter initialisation. Called by the servlet engine during the life cycle of the filter.