tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-tapestry/framework/src/org/apache/tapestry/pageload PageLoader.java
Date Mon, 31 Mar 2003 21:46:44 GMT
hlship      2003/03/31 13:46:44

  Modified:    framework/src/org/apache/tapestry/pageload PageLoader.java
  Log:
  Handle private assets with absolute paths properly.
  
  Revision  Changes    Path
  1.8       +16 -2     jakarta-tapestry/framework/src/org/apache/tapestry/pageload/PageLoader.java
  
  Index: PageLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/pageload/PageLoader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PageLoader.java	26 Mar 2003 19:53:22 -0000	1.7
  +++ PageLoader.java	31 Mar 2003 21:46:44 -0000	1.8
  @@ -901,13 +901,27 @@
               return new ExternalAsset(path, location);
   
           if (type == AssetType.PRIVATE)
  +        {
  +            IResourceLocation baseLocation = specificationLocation;
  +
  +            // Fudge a special case for private assets with complete paths.  The specificationLocation
  +            // can't be used because it is often a ContextResourceLocation,
  +            // not a ClasspathResourceLocation.
  +
  +            if (path.startsWith("/"))
  +            {
  +                baseLocation = new ClasspathResourceLocation(_resolver, "/");
  +                path = path.substring(1);
  +            }
  +
               return new PrivateAsset(
                   (ClasspathResourceLocation) findAsset(assetName,
                       component,
  -                    specificationLocation,
  +                    baseLocation,
                       path,
                       location),
                   location);
  +        }
   
           return new ContextAsset(
               (ContextResourceLocation) findAsset(assetName,
  
  
  

Mime
View raw message