--- java/org/apache/jasper/resources/LocalStrings.properties (revision 1678140) +++ java/org/apache/jasper/resources/LocalStrings.properties (working copy) @@ -389,7 +389,12 @@ xmlParser.skipBomFail=Failed to skip BOM when parsing XML input stream +jsp.tldCache.noTldInResourcePath=No TLD files were found in resource path [{0}]. +jsp.tldCache.tldInResourcePath=TLD files were found in resource path [{0}]. +jsp.tldCache.noTldInDir=No TLD files were found in directory [{0}]. +jsp.tldCache.tldInDir=TLD files were found in directory [{0}]. jsp.tldCache.noTldInJar=No TLD files were found in [{0}]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file. +jsp.tldCache.tldInJar=TLD files were found in JAR [{0}]. jsp.tldCache.noTldSummary=At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. #ELInterpreter --- java/org/apache/jasper/servlet/TldScanner.java (revision 1678140) +++ java/org/apache/jasper/servlet/TldScanner.java (working copy) @@ -220,6 +220,7 @@ protected void scanResourcePaths(String startPath) throws IOException, SAXException { + boolean found = false; Set dirList = context.getResourcePaths(startPath); if (dirList != null) { for (String path : dirList) { @@ -232,13 +233,24 @@ } else if (path.startsWith("/WEB-INF/tags/")) { // JSP 7.3.1: in /WEB-INF/tags only consider implicit.tld if (path.endsWith("/implicit.tld")) { + found = true; parseTld(path); } } else if (path.endsWith(TLD_EXT)) { + found = true; parseTld(path); } } } + if(!found){ + if (log.isDebugEnabled()) { + log.debug(Localizer.getMessage("jsp.tldCache.noTldInResourcePath", startPath)); + } + }else{ + if (log.isDebugEnabled()) { + log.debug(Localizer.getMessage("jsp.tldCache.tldInResourcePath", startPath)); + } + } } /** @@ -279,7 +291,8 @@ class TldScannerCallback implements JarScannerCallback { private boolean foundJarWithoutTld = false; - + private boolean foundFileWithoutTld = false; + @Override public void scan(JarURLConnection urlConn, String webappPath, boolean isWebapp) throws IOException { @@ -311,6 +324,11 @@ log.debug(Localizer.getMessage("jsp.tldCache.noTldInJar", jarURL.toString())); } + }else{ + if (log.isDebugEnabled()) { + log.debug(Localizer.getMessage("jsp.tldCache.tldInJar", + jarURL.toString())); + } } } @@ -321,6 +339,7 @@ if (!metaInf.isDirectory()) { return; } + foundFileWithoutTld = false; final Path filePath = file.toPath(); Files.walkFileTree(metaInf.toPath(), new SimpleFileVisitor() { @Override @@ -331,7 +350,8 @@ .toLowerCase(Locale.ENGLISH).endsWith(TLD_EXT)) { return FileVisitResult.CONTINUE; } - + + foundFileWithoutTld = true; String resourcePath; if (webappPath == null) { resourcePath = null; @@ -354,6 +374,17 @@ return FileVisitResult.CONTINUE; } }); + if (!foundFileWithoutTld) { + if (log.isDebugEnabled()) { + log.debug(Localizer.getMessage("jsp.tldCache.noTldInDir", + file.getAbsolutePath())); + } + }else{ + if (log.isDebugEnabled()) { + log.debug(Localizer.getMessage("jsp.tldCache.tldInDir", + file.getAbsolutePath())); + } + } } @Override