2013/11/27 <ma...@apache.org>: > Author: markt > Date: Wed Nov 27 19:27:19 2013 > New Revision: 1546165 > > URL: http://svn.apache.org/r1546165 > Log: > Need to convert Path to string before checking the extension > scanWebInfClasses() still requires an implementation for when > scanAllDirectories is enabled > > Modified: > tomcat/trunk/java/org/apache/jasper/servlet/TldScanner.java > > Modified: tomcat/trunk/java/org/apache/jasper/servlet/TldScanner.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/TldScanner.java?rev=1546165&r1=1546164&r2=1546165&view=diff > ============================================================================== > --- tomcat/trunk/java/org/apache/jasper/servlet/TldScanner.java (original) > +++ tomcat/trunk/java/org/apache/jasper/servlet/TldScanner.java Wed Nov 27 > 19:27:19 2013 > @@ -29,6 +29,7 @@ import java.util.ArrayList; > import java.util.Collection; > import java.util.HashMap; > import java.util.List; > +import java.util.Locale; > import java.util.Map; > import java.util.Set; > > @@ -317,7 +318,7 @@ public class TldScanner { > public FileVisitResult visitFile(Path file, > BasicFileAttributes attrs) > throws IOException { > - if (!file.endsWith(TLD_EXT)) { > + if > (!file.toString().toLowerCase(Locale.ENGLISH).endsWith(TLD_EXT)) { > return FileVisitResult.CONTINUE; > } > > @@ -336,7 +337,17 @@ public class TldScanner { > > @Override > public void scanWebInfClasses() throws IOException { > - // this is now handled when WEB-INF is scanned for resources > + // This is used when scanAllDirectories is enabled and one or > more > + // JARs have been unpacked into WEB-INF/classes as happens with > some > + // IDEs. > + > + // We know that WEB-INF/classes/META-INF must be a directory on > disk
Why? Anybody is free to pack their IDE-managed directory as a war file. Their context.xml may still have this option turned on. > + String webappPath = WEB_INF + "classes"; > + String realPath = context.getRealPath(webappPath); The realPath might be null here. > + > + File webInfClasses = new File(realPath); > + > + scan(webInfClasses, webappPath, true); > } > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org