cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luta.raph...@networks.vivendi.net
Subject Re: [Bugfix] Relative path problem under JRun
Date Wed, 19 Jan 2000 15:33:57 GMT
Stefano Mazzocchi wrote:
> 
> Philippe Lavoie wrote:
> >
> > *** ProducerFromFile.java       Tue Jan 18 18:45:40 2000
> > --- ProducerFromFile.java~      Tue Jan 18 14:25:20 2000
> > *************** public class ProducerFromFile extends Ab
> > *** 107,122 ****
> >               }
> >           } catch (NoSuchMethodError e) {
> >               // if there is no such method we must be in Servlet API 2.1
> > !           return ((request.getPathInfo() == null)
> > !               ? request.getRealPath(request.getRequestURI())
> > !               : request.getPathTranslated()).replace('\\','/');
> > !          } catch (MalformedURLException e) {
> >               throw new RuntimeException("Malformed request URL.");
> >           } catch (NullPointerException e) {
> >               // if there is no context set, we must be called from the
> > command line
> >               return request.getPathTranslated().replace('\\','/');
> >           }
> > -
> >       }
> >
> >       public String getStatus() {
> > --- 107,125 ----
> >               }
> >           } catch (NoSuchMethodError e) {
> >               // 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());
> > !             }
> > !         } catch (MalformedURLException e) {
> >               throw new RuntimeException("Malformed request URL.");
> >           } catch (NullPointerException e) {
> >               // if there is no context set, we must be called from the
> > command line
> >               return request.getPathTranslated().replace('\\','/');
> >           }
> >       }
> 
> 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.

--
Raphaƫl Luta - luta.raphael@networks.vivendi.net

Mime
View raw message