You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@apache.org on 2001/07/12 04:42:05 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core ApplicationDispatcher.java

craigmcc    01/07/11 19:42:05

  Modified:    catalina/src/share/org/apache/catalina/core
                        ApplicationDispatcher.java
  Log:
  Log a few exceptional conditions in addition to throwing the exceptions
  required by the spec.
  
  Revision  Changes    Path
  1.18      +15 -6     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java
  
  Index: ApplicationDispatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ApplicationDispatcher.java	2001/05/23 21:53:01	1.17
  +++ ApplicationDispatcher.java	2001/07/12 02:42:02	1.18
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v 1.17 2001/05/23 21:53:01 craigmcc Exp $
  - * $Revision: 1.17 $
  - * $Date: 2001/05/23 21:53:01 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v 1.18 2001/07/12 02:42:02 craigmcc Exp $
  + * $Revision: 1.18 $
  + * $Date: 2001/07/12 02:42:02 $
    *
    * ====================================================================
    *
  @@ -98,7 +98,7 @@
    * <code>javax.servlet.ServletResponseWrapper</code>.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.17 $ $Date: 2001/05/23 21:53:01 $
  + * @version $Revision: 1.18 $ $Date: 2001/07/12 02:42:02 $
    */
   
   final class ApplicationDispatcher
  @@ -297,10 +297,19 @@
           throws ServletException, IOException
       {
   	// Reset any output that has been buffered, but keep headers/cookies
  -	if (response.isCommitted())
  +        if (response.isCommitted()) {
  +            if (debug >= 1)
  +                log("  Forward on committed response --> ISE");
   	    throw new IllegalStateException
   		(sm.getString("applicationDispatcher.forward.ise"));
  -        response.resetBuffer();
  +        }
  +        try {
  +            response.resetBuffer();
  +        } catch (IllegalStateException e) {
  +            if (debug >= 1)
  +                log("  Forward resetBuffer() returned ISE: " + e);
  +            throw e;
  +        }
   
   	// Identify the HTTP-specific request and response objects (if any)
   	HttpServletRequest hrequest = null;