remm 01/09/26 10:51:07 Modified: catalina/src/share/org/apache/catalina/core StandardContextValve.java Log: - Error report and dispatching refactoring. - Remove some status report output code (everything is now done in one single place). Revision Changes Path 1.13 +8 -49 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java Index: StandardContextValve.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- StandardContextValve.java 2001/07/25 04:05:50 1.12 +++ StandardContextValve.java 2001/09/26 17:51:07 1.13 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v 1.12 2001/07/25 04:05:50 remm Exp $ - * $Revision: 1.12 $ - * $Date: 2001/07/25 04:05:50 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v 1.13 2001/09/26 17:51:07 remm Exp $ + * $Revision: 1.13 $ + * $Date: 2001/09/26 17:51:07 $ * * ==================================================================== * @@ -93,7 +93,7 @@ * when processing HTTP requests. * * @author Craig R. McClanahan - * @version $Revision: 1.12 $ $Date: 2001/07/25 04:05:50 $ + * @version $Revision: 1.13 $ $Date: 2001/09/26 17:51:07 $ */ final class StandardContextValve @@ -191,21 +191,12 @@ try { wrapper = (Wrapper) context.map(request, true); } catch (IllegalArgumentException e) { - badRequest(requestURI, (HttpServletResponse) response.getResponse()); - try { - response.finishResponse(); - } catch (IOException f) { - ; - } + badRequest(requestURI, + (HttpServletResponse) response.getResponse()); return; } if (wrapper == null) { notFound(requestURI, (HttpServletResponse) response.getResponse()); - try { - response.finishResponse(); - } catch (IOException e) { - ; - } return; } @@ -232,25 +223,9 @@ private void badRequest(String requestURI, HttpServletResponse response) { try { - requestURI = RequestUtil.filter(requestURI); - response.setStatus(HttpServletResponse.SC_BAD_REQUEST); - response.setContentType("text/html"); - PrintWriter writer = response.getWriter(); - writer.println(""); - writer.println(""); - writer.println("Tomcat Error Report"); - writer.println(""); - writer.println("

"); - writer.println("

HTTP Status 400 - " + requestURI + "

"); - writer.println(sm.getString("standardContext.badRequest", - requestURI)); - writer.println(""); - writer.println(""); - writer.flush(); + response.setStatus(HttpServletResponse.SC_BAD_REQUEST, requestURI); } catch (IllegalStateException e) { ; - } catch (IOException e) { - ; } } @@ -267,24 +242,8 @@ private void notFound(String requestURI, HttpServletResponse response) { try { - requestURI = RequestUtil.filter(requestURI); - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - response.setContentType("text/html"); - PrintWriter writer = response.getWriter(); - writer.println(""); - writer.println(""); - writer.println("Tomcat Error Report"); - writer.println(""); - writer.println("

"); - writer.println("

HTTP Status 404 - " + requestURI + "

"); - writer.println(sm.getString("standardContext.notFound", - requestURI)); - writer.println(""); - writer.println(""); - writer.flush(); + response.setStatus(HttpServletResponse.SC_NOT_FOUND, requestURI); } catch (IllegalStateException e) { - ; - } catch (IOException e) { ; }