Class FilterValve

java.lang.Object
All Implemented Interfaces:
FilterConfig, MBeanRegistration, Contained, JmxEnabled, Lifecycle, Valve

public class FilterValve extends ValveBase implements FilterConfig

A Valve to wrap a Filter, allowing a user to run Servlet Filters as a part of the Valve chain.

There are some caveats you must be aware of when using this Valve to wrap a Filter:

  • You get a separate instance of your Filter class distinct from any that may be instantiated within your application.
  • Calls to FilterConfig.getFilterName() will return null.
  • Calling FilterConfig.getServletContext() will return the proper ServletContext for a Valve/Filter attached to a <Context>, but will return a ServletContext which is nearly useless for any Valve/Filter specified on an <Engine> or >Host<.
  • Your Filter MUST NOT wrap the ServletRequest or ServletResponse objects, or an exception will be thrown.
See Also: