Score:0

Ignore directory in Tomcat TldScanner

cn flag

I run a Java-based CMS which places cached images in the WEB-INF folder, specifically in /WEB-INF/imagecache/. Unfortunately, this directory gets extremely large with lots of nested paths, and Tomcat restarts become excruciatingly slow - setting the log level for org.apache.jasper.servlet.TldScanner.level to FINE shows why, there is a ton of messages like this:

16-Mar-2022 13:50:56.109 FINE [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/imagecache/<snip>/].

Is there any way to completely ban the TldScanner from specific directories?

Score:1
in flag

scanResourcePaths will always scan every directory and file under /WEB-INF/, except for /WEB-INF/classes/* and /WEB-INF/lib/*. These values are hardcoded into the code, so you can't change them.

A better option would be not polluting the WEB-INF directory, but instead specify an external directory for cache data. This has the bonus advantage of not losing all your cache if you need to redeploy the application for any reason.

cn flag
Turned out the CMS has a config option for doing that... but too bad there is no filter option :( Thanks anyway!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.