bb.servlet
Class CacheDisablingFilter

java.lang.Object
  extended by bb.servlet.AbstractFilter
      extended by bb.servlet.CacheDisablingFilter
All Implemented Interfaces:
Filter

public class CacheDisablingFilter
extends AbstractFilter

This filter implements a universal cache-disabling service for an entire web application via its doFilter method.

This class is multithread safe: it is stateless.

Author:
Brent Boyer

Field Summary
 
Fields inherited from class bb.servlet.AbstractFilter
filterConfig
 
Constructor Summary
CacheDisablingFilter()
           
 
Method Summary
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          This method sets the response header for all incoming HTTP requests with values that should disable all caching for HTTP 1.1, HTTP 1.0, and any proxy server.
 
Methods inherited from class bb.servlet.AbstractFilter
destroy, init, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheDisablingFilter

public CacheDisablingFilter()
Method Detail

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
This method sets the response header for all incoming HTTP requests with values that should disable all caching for HTTP 1.1, HTTP 1.0, and any proxy server. Non-HTTP requests pass thru unmodified.

Specified by:
doFilter in interface Filter
Specified by:
doFilter in class AbstractFilter
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
chain - The filter chain we are processing
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet error occurs