cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: absolute references to stylesheets??
Date Wed, 05 Apr 2000 03:18:26 GMT
On Tue, 4 Apr 2000, Mark Dzmura wrote:

> Ulrich:
> 
> Using a URL to access an absolute resource means I have to:
> 
> 1. process a URL instead of a file at run time
> 2. change URL's when I move from development to deployment
> 
> I believe I have found the place in the XSLT code where this
> questionable interpretation of file location occurs:
> 
>                     try {
>                         if (url.indexOf("://") < 0) {
>                             local = new File(path + url);
>                         } else {
>                             local = new URL(url);
>                         }
> 
> This code very simply concatenates path and url to form the
> full file path...  It seems to me this code should not be so simple-minded,
> but should look more like this:
> 
>     try
>         {
>         if (url.indexOf("://") < 0)
>             {
>             if (url.startsWith("/"))
>                 local = new File(request.getPathInfo() + url);
>             else
>                 local = new File(path + url);
>             }
>         else
>             local = new URL(url);
>         }
> 
> With this implementation, requestes for absolute files are not hopelessly broken.
> Does anybody else agree??

That sounds reasonable to me, but before I commit the patch, does anyone
know if request.getPathInfo() is in fact reliably portable across servlet
engines? It seems to me that this might be one of those things that varies
from engine to engine...

- donald


Mime
View raw message