Bug 63115

Summary: JSP standalone compilation doesn't work. First folder in path is duplicate
Product: Tomcat 9 Reporter: Philippe <philippe.ruffinoni>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: CLOSED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 9.0.14   
Target Milestone: -----   
Hardware: PC   
OS: All   

Description Philippe 2019-01-25 13:34:36 UTC
In org.apache.jasper.JsjC class

the method "scanFilesInternal" use "context.getResourcePaths(input)" method to retrieve all resources available in "input" folder.
but all the paths returned by this method start with the value contains in "input" variable.
Then, scanFilesInternal iterate other all paths returned and call scanFilesInternal again (recursivity) for each of then. 
But, the value contains in "input" variable is concatenate with the current path (which already start with the value contains in "input"). So, the first part of the path is duplicated.

example:
 
private void scanFilesInternal(String input) {       <= input = /jsp/
Set<String> paths = context.getResourcePaths(input); <= paths [/jsp/home/,/jsp/actu/..]
...
  scanFilesInternal(input.substring(0, input.length() -1) + path);
           =>  scanFilesInternal("/jsp"+"/jsp/home/")<= /jsp/ appears twice!!

}
Comment 1 Mark Thomas 2019-01-25 17:22:49 UTC
Although the duplicate description is different, I believe these issues are the same. Please re-test with a build of the latest code from svn. If it helps, I can provide you with a pre-built tar.gz (Linux) or .zip (Windows) for testing.

*** This bug has been marked as a duplicate of bug 63056 ***
Comment 2 Philippe 2019-01-29 16:33:41 UTC
If you can provide me a pre-build for linux, I can re-test and confirm bug duplication.
Comment 3 Mark Thomas 2019-01-29 20:32:07 UTC
This is an entirely untested build of the latest svn source. Use it at your own risk.

http://people.apache.org/~markt/dev/v9.0.15-dev/
Comment 4 Philippe 2019-01-30 16:31:16 UTC
bug fixed, thanks