tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ignacio J. Ortega" <na...@siapi.es>
Subject RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/module s/generators ErrorHandler.java
Date Sun, 08 Jul 2001 00:33:12 GMT
Hola Larry:

This code along with some other ( related to SetHookFinder ) .. breaks
completely TC33 auth.., as the Status handler is called recursively ..
First with a 401 and later a 302... 

So i'm getting a error loop message in whenever i try the security
examples..

Any idea on how to fix it  ?

Saludos ,
Ignacio J. Ortega


> -----Mensaje original-----
> De: larryi@apache.org [mailto:larryi@apache.org]
> Enviado el: viernes 6 de julio de 2001 20:41
> Para: jakarta-tomcat-cvs@apache.org
> Asunto: cvs commit:
> jakarta-tomcat/src/share/org/apache/tomcat/modules/generators
> ErrorHandler.java
> 
> 
> larryi      01/07/06 11:41:02
> 
>   Modified:    src/share/org/apache/tomcat/modules/generators
>                         ErrorHandler.java
>   Log:
>   Fix recursive error handling if web.xml maps error code 404 
> to a non-existent
>   JSP page. With this fix, no response will be sent if status 
> handler is called
>   recursively. You will need to examine the log output to see 
> the error.
>   
>   If web.xml maps error code 404 to a non-existent html, use 
> default "not found"
>   handler instead of default "status" handler.
>   
>   Revision  Changes    Path
>   1.14      +19 -3     
> jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/
> ErrorHandler.java
>   
>   Index: ErrorHandler.java
>   ===================================================================
>   RCS file: 
> /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/g
> enerators/ErrorHandler.java,v
>   retrieving revision 1.13
>   retrieving revision 1.14
>   diff -u -r1.13 -r1.14
>   --- ErrorHandler.java	2001/07/05 20:40:45	1.13
>   +++ ErrorHandler.java	2001/07/06 18:41:00	1.14
>   @@ -191,8 +191,15 @@
>    	}
>    
>    	boolean isDefaultHandler = false;
>   +        if ( statusLoop( ctx, req ) ){
>   +            log( "Error loop for " + req + " error code " + code);
>   +            return;
>   +        }
>    	if( errorServlet==null ) {
>   -	    errorServlet=ctx.getServletByName( "tomcat.statusHandler");
>   +            if( code == 404 )
>   +                errorServlet=ctx.getServletByName( 
> "tomcat.notFoundHandler");
>   +            else
>   +                errorServlet=ctx.getServletByName( 
> "tomcat.statusHandler");
>    	    isDefaultHandler = true;
>    	}
>    
>   @@ -389,9 +396,18 @@
>    	}
>    	return false;
>        }
>   -
>   -
>    
>   +    /** Handle the case of status handler generating an error
>   +     */
>   +    private boolean statusLoop( Context ctx, Request req ) {
>   +        if ( 
> req.getAttribute("javax.servlet.error.status_code") != null ) {
>   +            if( ctx.getDebug() > 0 )
>   +                ctx.log( "Error: nested error inside 
> status servlet " +
>   +                        
> req.getAttribute("javax.servlet.error.status_code"));
>   +            return true;
>   +        }
>   +        return false;
>   +    }
>        
>    }
>    
>   
>   
>   
> 

Mime
View raw message