Can someone explain what <dispatcher>ERROR</dispatcher>
means? I cannot find any examples about it. I wanted to handle bad requests (for example when someone makes typo) with Filter and from it to forward to some jsp file. I wrote the following code:
<filter>
<filter-name>badRequestFilter</filter-name>
<filter-class>filter.BadRequestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>badRequestFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
I know that I can use <error-page>
in web.xml
, but I decide to try this(for practice). But this filter is not called and typos are not catched. What can be the reason for that? Maybe I misunderstood when this types of filters are called.
Thanks for your attention.