tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Suen" <>
Subject Re: Catching RequestDispatcher not found errors
Date Sat, 20 May 2006 01:15:55 GMT
On 5/19/06, Mark Thomas <> wrote:
> The RequestDispatcher is created in this class:
> ApplicationDispatcher implements RequestDispatcher
> The wrapper that checks if it is included before calling sendError is
> HTH,
> Mark

Thanks for your help.

Acording to the API, sendError from the *included servlet* will be ignored.
I think maybe this doesn't necessarily mean *Tomcat itself* can't do it. If
i'm trying to include a resource not existed after the response being
committed, the error message will be appended to the response, and sendError
be ignored.

Here's the snippet from

    if (requestUri == null) {
        requestUri = request.getRequestURI();
    } else {
        // We're included, and the response.sendError() below is going
        // to be ignored by the resource that is including us.
        // Therefore, the only way we can let the including resource
        // know is by including warning message in response
            sm.getString("defaultServlet.missingResource ",


If the response has already been committed, doing that will get a 404 error
page returned to the client, that means Tomcat set this status somewhere
else, or from some wrapper, but I failed to find it.

Any idea?

Best Regards

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message