Bug 58455

Summary: validate method in org.apache.catalina.webresources.StandardRoot forces a path to start with slash
Product: Tomcat 8 Reporter: yifan liu <yifanliu.uk>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 8.0.9   
Target Milestone: ----   
Hardware: PC   
OS: All   

Description yifan liu 2015-09-24 10:18:00 UTC
the validate method in org.apache.catalina.webresources.StandardRoot.java forces  a path start with '/'. 

it should check the 'org.apache.catalina.core.ApplicationContext.GET_RESOURCE_REQUIRE_SLASH' system property so that there is a chance to ignore the slash.

Currently, if I call 

org.apache.catalina.core.ApplicationContext.getResource("myresource.properties")

there will be a exception saying: 

The resource path [myresource.properties] is not valid

So I have to add a '/' before the resource name. But if I can not change it, the web application can not start.

I think this issue in all versions of tomcat 8

Thanks
Comment 1 Violeta Georgieva 2015-09-24 11:00:50 UTC

*** This bug has been marked as a duplicate of bug 58228 ***