Index: java/org/apache/catalina/webresources/StandardRoot.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>windows-1251 =================================================================== --- java/org/apache/catalina/webresources/StandardRoot.java (revision 1711254) +++ java/org/apache/catalina/webresources/StandardRoot.java (revision ) @@ -93,7 +93,21 @@ allResources.add(postResources); } + protected static final boolean GET_RESOURCE_REQUIRE_SLASH; + + static { + String requireSlash = System.getProperty( + "org.apache.catalina.core.ApplicationContext.GET_RESOURCE_REQUIRE_SLASH"); + if (requireSlash == null) { + GET_RESOURCE_REQUIRE_SLASH = true; + } else { + GET_RESOURCE_REQUIRE_SLASH = + Boolean.valueOf(requireSlash).booleanValue(); + } + } + + /** * Creates a new standard implementation of {@link WebResourceRoot}. A no * argument constructor is required for this to work with the digester. @@ -246,7 +260,14 @@ sm.getString("standardRoot.checkStateNotStarted")); } - if (path == null || path.length() == 0 || !path.startsWith("/")) { + if (!path.startsWith("/")) { + if (GET_RESOURCE_REQUIRE_SLASH) + return null; + else + path = "/" + path; + } + + if (path == null || path.length() == 0 ) { throw new IllegalArgumentException( sm.getString("standardRoot.invalidPath", path)); }