On 24.10.2015 05:11, Pradyut Bhattacharya wrote:
The URL
pattern therefore needs to be "/*"
Could not do anything with the above statement. May be an example could suffice.
Then maybe try this :
Instead of :
<filter-mapping>
<filter-name>dir_filter</filter-name>
<url-pattern>/web/*</url-pattern>
</filter-mapping>
try :
<filter-mapping>
<filter-name>dir_filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Explanation : in <servlet-mapping> and <filter-mapping>, the <url-pattern> is *relative to
the webapp context*. In your case, because of the way you have configured this, the webapp
has a context of "/TestApp/web". Therefore, if you want the filter to apply to everything
under "/TestApp/web", you have to map it to "/*".
So that, in URL-space, it will apply to "/TestApp/web/*".
The way you originally mapped it above, it would apply to "/TestApp/web/web/*", which is
why it seemed not to be working. The filter was there, but never invoked, because there
was never any request URL matching "/TestApp/web/web/*".
Clearer ?
Note that this is the same as what Mark was saying, only in many more words.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org