tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java
Date Sat, 02 Sep 2000 22:51:32 GMT
jon         00/09/02 15:51:31

  Modified:    src/share/org/apache/tomcat/core ContextManager.java
  Log:
  ok, i just tested this patch and at least tomcat doesn't send a NPE
  to the screen anymore and instead prints an error message to the screen.
  
  Revision  Changes    Path
  1.128     +8 -3      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.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- ContextManager.java	2000/08/30 05:15:38	1.127
  +++ ContextManager.java	2000/09/02 22:51:31	1.128
  @@ -976,15 +976,20 @@
   	if( errorPath != null ) {
   	    errorServlet=getHandlerForPath( ctx, errorPath );
   	}
  -	if( debug>0 )
  -	    ctx.log( "Handler " + errorServlet + " " + errorPath);
   
   	if( errorServlet==null )
   	    errorServlet=ctx.getServletByName( "tomcat.statusHandler");
   
  -	req.setAttribute("javax.servlet.error.status_code",new Integer( code));
  +	if (errorServlet == null) {
  +	    ctx.log( "Handler errorServlet is null! errorPath:" + errorPath);
  +	    return;
  +	}
   
  +	req.setAttribute("javax.servlet.error.status_code",new Integer( code));
   	req.setAttribute("tomcat.servlet.error.request", req);
  +
  +	if( debug>0 )
  +	    ctx.log( "Handler " + errorServlet + " " + errorPath);
   
   	errorServlet.service( req, res );
       }
  
  
  

Mime
View raw message