cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Lavoie <philippe.lav...@cactus.ca>
Subject [Bugfix] Relative path problem under JRun
Date Tue, 18 Jan 2000 23:46:55 GMT
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('\\','/');
          }
      }

Mime
View raw message