I have a web application with the following structure:
TOMCAT_HOME
|
webapps
|_myapp
|-html/
|-various directories
|-WEB-INF/
|-index.html
The application has various servlets that are registered over various paths.
The application itself can be accessed via http://IP:PORT/myapp/
This of courses causes to get the index.html (in the welcome list).
My question is, how would I register a filter for specifically the access of the root directory but not the subdirectories i.e. the url-mapping not to be /*
If I place as url-pattern / seems not to work.
So the filter would intercept only this request http://IP:PORT/myapp/ and not http://IP:PORT/myapp/path or http://IP:PORT/myapp/servlet/path.
Additionally the filter would intercept a request like http://IP:PORT/myapp/index.html which is equivalent to the one I aim.
Thanks
You can easily test for
/and do your thing, otherwise let it pass through. With a/*URL pattern.