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 11:49:16 GMT
Philippe Lavoie wrote:
> 
> As mentionned in the mailing list, there is a problem in determining the
> relative path
> of a file with JRun with the following patch it works.
> 
> I have absolutely no clue why the new code doesn't work properly. Because
> the more I look at the solution, the less I see differences. Perhaps someone
> can show me the difference between the two versions of that piece of code?
> Anyway, with that fix you can add JRun2.3.3 under windows NT as a supported
> platform for 1.6.
> 
> Phil
> 
> *** 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. 

???

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