我的应用程序不使用任何 servlet 注释。我想跳过注释扫描。但看起来 Tomcat 11.0 忽略了
metadata-complete="true"
属性。我是否必须使用 servlet 版本 6.1 以不同的方式处理此问题?这是 Tomcat 11.0 中的错误吗?
我的文件 WEB-INF/web.xml 开头为:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee web-app_6_1.xsd"
version="6.1"
metadata-complete="true">
日志输出为:
INFORMATION [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/11.0.0]
INFORMATION [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [foobar.war]
FEIN [main] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/].
FEIN [main] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:....
...
INFORMATION [main] org.apache.jasper.servlet.TldScanner.scanJars 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.
在文件中
META-INF/context.xml
我已经设置:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<JarScanner>
<JarScanFilter pluggabilityScan="" pluggabilitySkip="*.jar" tldScan="" tldSkip="*.jar"/>
</JarScanner>
</Context>
现在不再扫描了。