title: Is there a regular expression based servlet filter for web.xml?
body: <p>I am in the process of migrating some code from Guice to Spring. guice-servlet has the nice feature that allows you to match servlet filters using regular expressions. For example I am using</p>
  
  <pre><code>filterRegex("^.*\\.cache\\..*$").through(ForceCacheFilter.class);
  </code></pre>
  
  <p>I need to replicate this in Spring.</p>
  
  <p>I could easily write a filter that takes a regular expression and the class name of a filter to delegate to as a parameter/attribute. It would match the URL against the regexp and delegate to the filter class if required. I guess this could be taken further and have a filter that dispatches to multiple filters based on regexps - just like what Guice is doing.</p>
  
  <p>What I am surprised about is that I haven't been able to find something that does this already. Maybe I haven't looked hard enough or maybe its not such a good idea?</p>
  
  <p>Does something like this exist or do I need to write some code?</p>