Bug 52156

Summary: ServletContext.getResource(path) doesn't accept ".." anymore
Product: Tomcat 7 Reporter: Arnaud <amasson>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 7.0.22   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Arnaud 2011-11-08 18:59:53 UTC
With WAR-packaged webapp,
   getServletContext().getResource("/mydata/../mydata/myfile.txt")
should return the same URL as
   getServletContext().getResource("/mydata/myfile.txt")
but returns NULL instead.

It's ok for folder-based webapp.
It was working in Tomcat 6.0.20.
It looks like Bug 10629 (WARDirContext.java regression?).
Comment 1 Mark Thomas 2011-11-08 23:31:43 UTC
Thanks for the report. This has been fixed in trunk and 7.0.x and will be included in 7.0.23 onwards.