Reputation: 1480
I'm trying to capture all the URLs requested to WAS. I'm running a web app over WAS 6.0 and iIdefined a filter like this in the web.xml
<filter>
<filter-name>StatusValidationFilter</filter-name>
<filter-class>com.test.StatusValidationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>StatusValidationFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
But when I'm get a 404 error the filter isn't called, is like the WAS just break the app execution, so the question is, is the filter correctly configured?
If I try a .do url is working but if I try a url that generates a 404 error the filter isn't called.
Upvotes: 0
Views: 116
Reputation: 252
The filter seems ok. But it is a bad practice to handle errors within a filter.
You should use the <error-page>
tag.
So, this way, during the redirection the filter chain is still maintained.
Upvotes: 1