changeset 80:4724fc7b4733

add slashes to paths for getRealPath to work with Tomcat 8.
author casties
date Mon, 21 Jul 2014 17:28:15 +0200
parents 4466194a4eae
children 3be57c18c693
files src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java	Fri Jul 18 18:08:41 2014 +0200
+++ b/src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java	Mon Jul 21 17:28:15 2014 +0200
@@ -350,7 +350,7 @@
             String webPath = path;
             if (!webPath.startsWith("/")) {
                 // relative path in webapp starts in WEB-INF
-                webPath = "WEB-INF/" + webPath;
+                webPath = "/WEB-INF/" + webPath;
             }
             ps = sc.getResourceAsStream(webPath);
             if (ps == null) {
@@ -387,7 +387,7 @@
         // is the filename absolute?
         if (!f.isAbsolute() && sc != null) {
             // relative path -> use getRealPath to resolve in webapp
-            filename = sc.getRealPath("WEB-INF/" + filename);
+            filename = sc.getRealPath("/WEB-INF/" + filename);
         }
         return filename;
     }