I've created a "toy" filter and servlet to experiment with filters in Tomcat 5.0.28. If I map the filter to the servlet like this

<filter-mapping> ...
     <dispatcher>ERROR</dispatcher>
... </filter-mapping>

and invoke the following JSP

<%@ page errorPage="/filtex-dummy.do" %>
${10%0} <%-- throw exception --%>

then the servlet executes but the filter does not. If I change the mapping to

<filter-mapping> ...
     <dispatcher>FORWARD</dispatcher>
... </filter-mapping>

then both the filter and the servlet execute.

A lengthy search seems to indicate that other folks have encountered this, but I can't determine whether it's a bug or just a misunderstanding of the standard. If it's my misunderstanding, please point me to an explanation of when

        <dispatcher>ERROR</dispatcher>

will cause the filter to execute.

Note: the v2.4 servlet spec seems to indicate that the <filter-mapping> must use <url-pattern> when <dispatcher> has a value of ERROR, but I tried both <servlet-name> and <url-pattern> with no apparent difference in behavior.

Thanks in advance and best regards,
Steve Farmer


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to