Reputation: 5389
I'd like to create a servlet filter that applies to all my URL paths except for a few a specify (or ideally specified by a regex).
Is that possible? Unfortunately I can't change the paths such that all of my other URLs start with something common....
Upvotes: 0
Views: 1313
Reputation: 20837
You can't do this via spec-compliant configuration. You do have a couple of options:
<filter-mapping>
s so that they are much more specific (e.g. /foo
becomes /foo/bar
and /foo/baz
but not /foo/foo
).<init-param>
if you want to configure them in web.xml
, but you'll have to do the real work yourself.<filter-mapping>
s and <servlet-mapping>
s that do share a common URI prefix and start using those (leaving the old mappings in effect).Upvotes: 1