I am writing a servlet filter and want to define a url pattern in web.xml in such a way that all the css, javascript and png files gets filtered and my filter executes only on the rest of the files.Can anyone give some pointers on the same.What url pattern to put in web.xml so that it excludes the static resources.
*.htm. It will not intercept any of your static resources but you will have to match this pattern whenever you make an HTTP call to the servlet. Alternatively, you can also use the<servlet-name>element within the filter mapping and provide it the name of a servlet which, if called, will cause this filter to execute.