tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java
Date Wed, 07 Mar 2001 07:56:22 GMT
costin      01/03/06 23:56:21

  Modified:    src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Other places where getContext() needs to be checked.
  
  Revision  Changes    Path
  1.173     +22 -7     jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.172
  retrieving revision 1.173
  diff -u -r1.172 -r1.173
  --- ContextManager.java	2001/03/07 07:13:26	1.172
  +++ ContextManager.java	2001/03/07 07:56:20	1.173
  @@ -708,8 +708,12 @@
   	    handleError( req, res, ex );
   	}
   	finally {
  -	    BaseInterceptor reqI[]= req.getContext().getContainer().
  -		getInterceptors(Container.H_postRequest);
  +	    BaseInterceptor reqI[];
  +	    if( req.getContext()==null )
  +		reqI=getContainer().getInterceptors( Container.H_handleError );
  +	    else
  +		reqI= req.getContext().getContainer().
  +		    getInterceptors(Container.H_postRequest);
   
   	    for( int i=0; i< reqI.length; i++ ) {
   		reqI[i].postRequest( req, res );
  @@ -756,8 +760,13 @@
   	    String roles[]=req.getRequiredRoles();
   	    if(roles != null ) {
   		status=0;
  -		BaseInterceptor reqI[]= req.getContext().getContainer().
  -                getInterceptors(Container.H_authorize);
  +		BaseInterceptor reqI[];
  +		if( req.getContext()==null )
  +		    reqI=getContainer().
  +			getInterceptors( Container.H_handleError );
  +		else
  +		    reqI = req.getContext().getContainer().
  +			getInterceptors(Container.H_authorize);
   
   		// Call all authorization callbacks. 
   		for( int i=0; i< reqI.length; i++ ) {
  @@ -808,7 +817,10 @@
   	    // the context is not fully initialized.
   	    req.setAttribute("javax.servlet.error.message",
   			     "Application not available");
  -	    handleStatus( req, req.getResponse(), 503 ); // service unavailable
  +	    // return error code - the caller will handle it
  +	    // handleStatus( req, req.getResponse(), 503 );
  +	    // service unavailable
  +	    return 503;
   	}
   	
   	ri=req.getContext().getContainer().
  @@ -918,8 +930,11 @@
   	
   	BaseInterceptor ri[];
   	int status;
  -	ri=req.getContext().getContainer().
  -	    getInterceptors( Container.H_handleError );
  +	if( req.getContext()==null )
  +	    ri=getContainer().getInterceptors( Container.H_handleError );
  +	else
  +	    ri=req.getContext().getContainer().
  +		getInterceptors( Container.H_handleError );
   	
   	for( int i=0; i< ri.length; i++ ) {
   	    status=ri[i].handleError( req, res, null );
  
  
  

Mime
View raw message