I wrote a filter that needs to be invoked every time a url on my site is accessed EXCEPT the CSS, JS, and IMAGE files. So in my definition I'd like to have something like:
<filter-mapping>
<filter-name>myAuthorizationFilter</filter-name>
<url-pattern>NOT /css && NOT /js && NOT /images</url-pattern>
</filter-mapping>
Is there anyway to do this? The only documentation I can find has only /*
UPDATE:
I ended up using something similar to an answer provided by Mr.J4mes:
private static Pattern excludeUrls = Pattern.compile("^.*/(css|js|images)/.*$", Pattern.CASE_INSENSITIVE);
private boolean isWorthyRequest(HttpServletRequest request) {
String url = request.getRequestURI().toString();
Matcher m = excludeUrls.matcher(url);
return (!m.matches());
}