On 5/19/06, Mark Thomas <[EMAIL PROTECTED]> 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

Reply via email to