View | Details | Raw Unified | Return to bug 58228
Collapse All | Expand All

(-)java/org/apache/catalina/webresources/StandardRoot.java (-1 / +22 lines)
Lines 93-99 Link Here
93
        allResources.add(postResources);
93
        allResources.add(postResources);
94
    }
94
    }
95
95
96
    protected static final boolean GET_RESOURCE_REQUIRE_SLASH;
96
97
98
99
    static {
100
        String requireSlash = System.getProperty(
101
                "org.apache.catalina.core.ApplicationContext.GET_RESOURCE_REQUIRE_SLASH");
102
        if (requireSlash == null) {
103
            GET_RESOURCE_REQUIRE_SLASH = true;
104
        } else {
105
            GET_RESOURCE_REQUIRE_SLASH =
106
                    Boolean.valueOf(requireSlash).booleanValue();
107
        }
108
    }
109
110
97
    /**
111
    /**
98
     * Creates a new standard implementation of {@link WebResourceRoot}. A no
112
     * Creates a new standard implementation of {@link WebResourceRoot}. A no
99
     * argument constructor is required for this to work with the digester.
113
     * argument constructor is required for this to work with the digester.
Lines 246-252 Link Here
246
                    sm.getString("standardRoot.checkStateNotStarted"));
260
                    sm.getString("standardRoot.checkStateNotStarted"));
247
        }
261
        }
248
262
249
        if (path == null || path.length() == 0 || !path.startsWith("/")) {
263
        if (!path.startsWith("/")) {
264
            if (GET_RESOURCE_REQUIRE_SLASH)
265
                return null;
266
            else
267
                path = "/" + path;
268
        }
269
270
        if (path == null || path.length() == 0 ) {
250
            throw new IllegalArgumentException(
271
            throw new IllegalArgumentException(
251
                    sm.getString("standardRoot.invalidPath", path));
272
                    sm.getString("standardRoot.invalidPath", path));
252
        }
273
        }

Return to bug 58228