tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/naming/resources ProxyDirContext.java
Date Thu, 12 Jun 2003 22:03:35 GMT
remm        2003/06/12 15:03:35

  Modified:    catalina/src/share/org/apache/naming/resources
                        ProxyDirContext.java
  Log:
  - Add /WEB-INF/lib and /WEB-INF/classes as non cacheable.
  - This should be configurable eventually, but I think it should work fine
    for 99% of apps.
  
  Revision  Changes    Path
  1.11      +17 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java
  
  Index: ProxyDirContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ProxyDirContext.java	24 Apr 2003 17:02:44 -0000	1.10
  +++ ProxyDirContext.java	12 Jun 2003 22:03:34 -0000	1.11
  @@ -233,6 +233,12 @@
           new ImmutableNameNotFoundException();
   
   
  +    /**
  +     * Non cacheable resources.
  +     */
  +    protected String[] nonCacheable = { "/WEB-INF/lib/", "/WEB-INF/classes/" };
  +
  +
       // --------------------------------------------------------- Public Methods
   
   
  @@ -1427,6 +1433,13 @@
           throws NamingException {
           if (cache == null)
               return (null);
  +        if (name == null)
  +            name = "";
  +        for (int i = 0; i < nonCacheable.length; i++) {
  +            if (name.startsWith(nonCacheable[i])) {
  +                return (null);
  +            }
  +        }
           CacheEntry cacheEntry = cache.lookup(name);
           if (cacheEntry == null) {
               cacheEntry = new CacheEntry();
  
  
  

---------------------------------------------------------------------
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