tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Suen" <stephen.s...@gmail.com>
Subject Re: Catching RequestDispatcher not found errors
Date Fri, 19 May 2006 03:53:25 GMT
On 5/19/06, Mark Thomas <markt@apache.org> wrote:Stephen Suen wrote:
> Can any body tell me where I can find such source code, and give me some
> basic explanation on it.

http://svn.apache.org/repos
>
>
> /asf/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
>
> Search for SC_NOT_FOUND
>
> Mark



Thanks for the help.

I have found this, but as it says in the following source code:

    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
        response.getWriter().write(
            sm.getString("defaultServlet.missingResource",
            requestUri));
    }

    response.sendError(HttpServletResponse.SC_NOT_FOUND,
                       requestUri);

The call to sendError should be ignored, then why a 404 error page returns?
I think maybe Tomcat overrides this behaviour or does some trick elsewhere.
Can you give me more help?

Best Regards

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