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-catalina/catalina/src/share/org/apache/catalina/core StandardHostValve.java
Date Sat, 05 Apr 2003 03:57:58 GMT
costin      2003/04/04 19:57:58

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardHostValve.java
  Log:
  Avoid NPE
  
  Revision  Changes    Path
  1.3       +13 -7     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostValve.java
  
  Index: StandardHostValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostValve.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StandardHostValve.java	13 Mar 2003 02:26:32 -0000	1.2
  +++ StandardHostValve.java	5 Apr 2003 03:57:58 -0000	1.3
  @@ -145,6 +145,8 @@
           throws IOException, ServletException {
   
           // Validate the request and response object types
  +        // XXX This should move to Engine ( the entry point )
  +        // will it be skiped if the mapper maps the valve ? 
           if (!(request.getRequest() instanceof HttpServletRequest) ||
               !(response.getResponse() instanceof HttpServletResponse)) {
               return;     // NOTE - Not much else we can do generically
  @@ -161,9 +163,13 @@
           }
   
           // Bind the context CL to the current thread
  -        Thread.currentThread().setContextClassLoader
  -            (context.getLoader().getClassLoader());
  -
  +        if( context.getLoader() != null ) {
  +            // Not started - it should check for availability first
  +            // This should eventually move to Engine, it's generic.
  +            Thread.currentThread().setContextClassLoader
  +                    (context.getLoader().getClassLoader());
  +        }
  +        
           // Update the session last access time for our session (if any)
           HttpServletRequest hreq = (HttpServletRequest) request.getRequest();
           String sessionId = hreq.getRequestedSessionId();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message