diff --git a/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppContext.java b/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppContext.java index 0eeab802313..47748aba171 100644 --- a/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppContext.java +++ b/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppContext.java @@ -809,13 +809,15 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL if (getResourceBase() == null) return null; - // Iw there a WEB-INF directory? - Resource webInf = getResourceBase().resolve("WEB-INF/"); // TODO: what does this do in a collection? + // Is there a WEB-INF directory anywhere in the Resource Base? + // ResourceBase could be a ResourceCollection + // The result could be a ResourceCollection with multiple WEB-INF directories + // Can return from WEB-INF/lib/foo.jar!/WEB-INF + // Can also never return from a META-INF/versions/#/WEB-INF location + Resource webInf = getResourceBase().resolve("WEB-INF/"); if (!webInf.exists() || !webInf.isDirectory()) return null; - // TODO: should never return from WEB-INF/lib/foo.jar!/WEB-INF - // TODO: should also never return from a META-INF/versions/#/WEB-INF location return webInf; } diff --git a/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/WebAppContext.java b/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/WebAppContext.java index 412ff3987dd..cbfdc3f45a7 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/WebAppContext.java +++ b/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/WebAppContext.java @@ -811,7 +811,11 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL if (super.getBaseResource() == null) return null; - // Iw there a WEB-INF directory? + // Is there a WEB-INF directory anywhere in the Resource Base? + // ResourceBase could be a ResourceCollection + // The result could be a ResourceCollection with multiple WEB-INF directories + // Can return from WEB-INF/lib/foo.jar!/WEB-INF + // Can also never return from a META-INF/versions/#/WEB-INF location Resource webInf = super.getBaseResource().resolve("WEB-INF/"); if (!webInf.exists() || !webInf.isDirectory()) return null;