cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [Bugfix] Relative path problem under JRun
Date Wed, 19 Jan 2000 23:26:09 GMT
Philippe Lavoie wrote:
> 
> > Stefano Mazzocchi wrote:
> > >
> > > > !           return ((request.getPathInfo() == null)
> > > > !               ? request.getRealPath(request.getRequestURI())
> > > > !               : request.getPathTranslated()).replace('\\','/');
> > > > !          } catch (MalformedURLException e) {
> > > >               throw new RuntimeException("Malformed
> 
> > > >               // if there is no such method we must be in
> > Servlet API 2.1
> > > > !             if (request.getPathInfo() != null) {
> > > > !                 // this must be Apache JServ
> > > > !                 return
> > request.getPathTranslated().replace('\\','/');
> > > > !             } else {
> > > > !                 // otherwise use the deprecated method
> > on all other
> > > > servlet engines.
> > > > !                 return
> > request.getRealPath(request.getRequestURI());
> >
> > > I'm probably missing something but this patch is totally equivalent.
> > >
> >
> > No. replace() is not called on the result of getRealPath() in
> > the patched
> > version.
> >
> 
> The first part is
> 
> ((request.getPathInfo() == null)
>              ? request.getRealPath(request.getRequestURI())
>               : request.getPathTranslated())
> 
> Then that result string goes through .replace('\\','/');
> 
> So the 1.6 version is missing a replace for the == null case.
> 
> Took me a while, to find out what 1.5 was doing right. Basically
> the way it is formated makes that piece of code a bit misleading.
> But it is very concise :)

Oh, shit shit shit... you're totally right... damn cryptic code. I'm
patching this right away.

Thanks again.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message