You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by la...@locus.apache.org on 2000/11/09 14:27:36 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/facade RequestDispatcherImpl.java

larryi      00/11/09 05:27:36

  Modified:    src/share/org/apache/tomcat/facade Tag: tomcat_32
                        RequestDispatcherImpl.java
  Log:
  Since ServletWrapper's service() method can now throw exceptions, we
  need to catch these exceptions in include() so the request can be restored.
  Then rethrow the exception.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.4   +15 -1     jakarta-tomcat/src/share/org/apache/tomcat/facade/Attic/RequestDispatcherImpl.java
  
  Index: RequestDispatcherImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/Attic/RequestDispatcherImpl.java,v
  retrieving revision 1.8.2.3
  retrieving revision 1.8.2.4
  diff -u -r1.8.2.3 -r1.8.2.4
  --- RequestDispatcherImpl.java	2000/11/07 03:16:48	1.8.2.3
  +++ RequestDispatcherImpl.java	2000/11/09 13:27:36	1.8.2.4
  @@ -318,7 +318,14 @@
   	// for the realRequest ( since the real request will still have the
   	// original handler/wrapper )
   	ServletWrapper wr=subRequest.getWrapper();
  -	if( wr!=null ) wr.service(realRequest, realResponse);
  +	Throwable t = null;
  +	if( wr!=null ) {
  +	    try {
  +		wr.service(realRequest, realResponse);
  +	    } catch (Throwable t1) {
  +		t = t1;
  +	    }
  +	}
   
   	// After request, we want to restore the include attributes - for
   	// chained includes.
  @@ -339,6 +346,13 @@
   	// revert to the response behavior
   	if( ! old_included ) {
   	    realResponse.setIncluded( false );
  +	}
  +
  +	if (t != null) {
  +	    if (t instanceof IOException)
  +		throw (IOException) t;
  +	    else if (t instanceof ServletException)
  +		throw (ServletException) t;
   	}
       }