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/04/08 01:48:35 UTC

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

craigmcc    01/04/07 16:48:35

  Modified:    catalina/src/share/org/apache/catalina/core
                        ApplicationFilterChain.java
  Log:
  If a filter or servlet throws a security exception when executed under a
  security manager, make the ultimate exception report more explicit by including
  the offending exception as the root cause of the ServletException we rethrow.
  
  Revision  Changes    Path
  1.6       +10 -9     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java
  
  Index: ApplicationFilterChain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ApplicationFilterChain.java	2001/02/04 00:50:09	1.5
  +++ ApplicationFilterChain.java	2001/04/07 23:48:35	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java,v 1.5 2001/02/04 00:50:09 glenn Exp $
  - * $Revision: 1.5 $
  - * $Date: 2001/02/04 00:50:09 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java,v 1.6 2001/04/07 23:48:35 craigmcc Exp $
  + * $Revision: 1.6 $
  + * $Date: 2001/04/07 23:48:35 $
    *
    * ====================================================================
    *
  @@ -93,7 +93,7 @@
    * method itself.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.5 $ $Date: 2001/02/04 00:50:09 $
  + * @version $Revision: 1.6 $ $Date: 2001/04/07 23:48:35 $
    */
   
   final class ApplicationFilterChain implements FilterChain {
  @@ -181,11 +181,12 @@
                   );                 
               } catch( PrivilegedActionException pe) {
                   Exception e = pe.getException();
  -                if( e.getClass().getName().equals("javax.servlet.ServletException") )
  -                    throw (ServletException)e; 
  -		if( e.getClass().getName().equals("java.io.IOException") )
  -                    throw (IOException)e;        
  -		throw new ServletException(e.getMessage());
  +                if (e instanceof ServletException)
  +                    throw (ServletException) e;
  +                else if (e instanceof IOException)
  +                    throw (IOException) e;
  +                else
  +                    throw new ServletException(e.getMessage(), e);
               }
           } else {
               internalDoFilter(request,response);