Question: I'd like the ability to modify/configure filters in a different way than web.xml. Here is a static configuration of 2 filters. I'd like the ability to have one filter statically configured and allow that filter to load additional filters. I just wanted to know if anyone knows of lib that already has this.

Using Servlet API 2.5

```xml
<web-app>
  ...
  <filter>
    <filter-name>MyFilter1</filter-name>
    <filter-class>com.me.MyFilter1</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>MyFilter1</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  ...
  <filter>
    <filter-name>MyFilter2</filter-name>
    <filter-class>com.me.MyFilter2</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>MyFilter2</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  ...
</web-app>

```

I've seen this done in Guice with GuiceFilter where the Filters are configured at runtime.

Answer: 
Servlet 3.0 has the `@WebFilter` annotation to define a filter. No need to declare it in web.xml anymore. 

But loading a filter from a filter is not supported. You could implement it yourself: it's "just" the chain of responsibility pattern, but why would you?
It can be achieved in easy steps, even for pre-3.0 Servlet spec:

1. Add a filter containing a static & ordered collection of Classes (chain).
2. Map the filter to intercept every traffic.
3. Manipulate the order & existence of your helper classes (those will be called privately by your filter upon interception of traffic) in the chain.

Ref: Xstream uses same kind of pattern for Serializer, well not with Servlet/Filter though. :)