You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Claude Montpetit <ja...@claudemontpetit.com> on 2002/02/21 04:01:39 UTC

Error page servlet and Filter invocation


I created a servlet that handles errors. This servlet gets executed when
specific errors occur, as defined in my web.xml file. 

The problem: I mapped a filter to this servlet and the filter NEVER
execute when the servlet is invoked by an error (following a sendError
call). But if I call the error servlet directly (no error, no
sendError), the filter executes normally.

Has anyone come across this behavior?

Claude



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Error page servlet and Filter invocation

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 20 Feb 2002, Claude Montpetit wrote:

> Date: Wed, 20 Feb 2002 22:01:39 -0500
> From: Claude Montpetit <ja...@claudemontpetit.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: Error page servlet and Filter invocation
>
>
>
> I created a servlet that handles errors. This servlet gets executed when
> specific errors occur, as defined in my web.xml file.
>
> The problem: I mapped a filter to this servlet and the filter NEVER
> execute when the servlet is invoked by an error (following a sendError
> call). But if I call the error servlet directly (no error, no
> sendError), the filter executes normally.
>
> Has anyone come across this behavior?
>

Yes ... it's what the servlet spec requires.

Filters are only invoked on the *original* request, before the service()
method of your servlet is called.  They are *not* executed in front of
error servlets, or (for that matter) servlets that are invoked via a
request dispatcher.

> Claude
>

Craig McClanahan


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>