"Fossies" - the Fresh Open Source Software Archive

Member "apache-tomcat-8.5.58/webapps/docs/config/jar-scan-filter.html" (10 Sep 2020, 10656 Bytes) of package /windows/www/apache-tomcat-8.5.58-windows-x64.zip:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the project site itself.

The Jar Scan Filter Component

Table of Contents

Introduction

The Jar Scan Filter element represents the component that filters results from the Jar Scanner before they are passed back to the application. It is typically used to skip the scanning of JARs that are known not to be relevant to some or all types of scan.

A Jar Scan Filter element MAY be nested inside a Jar Scanner component.

For example you can specify additional jar files when scanning for pluggable features:

<Context>
  ...
  <JarScanner>
    <JarScanFilter
        pluggabilityScan="${tomcat.util.scan.StandardJarScanFilter.jarsToScan},
                       my_pluggable_feature.jar"/>
  </JarScanner>
  ...
</Context>

If a Jar Scan Filter element is not included, a default Jar Scan Filter configuration will be created automatically, which is sufficient for most requirements.

Attributes

Common Attributes

All implementations of Jar Scan Filter support the following attributes:

Attribute Description
className

Java class name of the implementation to use. This class must implement the org.apache.tomcat.JarScanFilter interface. If not specified, the standard value (defined below) will be used.

Standard Implementation

The standard implementation of Jar Scan Filter is org.apache.tomcat.util.scan.StandardJarScanFilter. Additional attributes that it supports (in addition to the common attributes listed above) are listed in the table.

The values for pluggabilitySkip, pluggabilityScan, tldSkip, tldScan attributes are lists of file name pattern. The patterns are separated by comma (','). The leading and trailing whitespace characters in a pattern are ignored. The patterns are matched case-sensitively. The following two special characters are supported:

  • '*' - means zero or more characters,
  • '?' - means one and only one character.

Note that excluding a JAR from the pluggability scan will prevent a ServletContainerInitializer from being loaded from a web application JAR (i.e. one located in /WEB-INF/lib) but it will not prevent a ServletContainerInitializer from being loaded from the container (Tomcat). To prevent a ServletContainerInitializer provided by container from being loaded, use the containerSciFilter property of the Context.

Attribute Description
pluggabilitySkip

The comma separated list of JAR file name patterns to skip when scanning for pluggable features introduced by Servlet 3.0 specification. If not specified, the default is obtained from the tomcat.util.scan.StandardJarScanFilter.jarsToSkip system property.

pluggabilityScan

The comma separated list of JAR file name patterns to scan when scanning for pluggable features introduced by Servlet 3.0 specification. If not specified, the default is obtained from the tomcat.util.scan.StandardJarScanFilter.jarsToScan system property.

defaultPluggabilityScan

Controls if JARs are scanned or skipped by default when scanning for the pluggable features. If true, a JAR is scanned when its name either matches none of pluggabilitySkip patterns or any of pluggabilityScan patterns. If false, a JAR is scanned when its name matches any of pluggabilityScan patterns and none of pluggabilitySkip patterns. If not specified, the default value is true.

tldSkip

The comma separated list of JAR file name patterns to skip when scanning for tag libraries (TLDs). If not specified, the default is obtained from the tomcat.util.scan.StandardJarScanFilter.jarsToSkip system property.

tldScan

The comma separated list of JAR file name patterns to scan when scanning for tag libraries (TLDs). If not specified, the default is obtained from the tomcat.util.scan.StandardJarScanFilter.jarsToScan system property.

defaultTldScan

Controls if JARs are scanned or skipped by default when scanning for TLDs. If true, a JAR is scanned when its name either matches none of tldSkip patterns or any of tldScan patterns. If false, a JAR is scanned when its name matches any of tldScan patterns and none of tldSkip patterns. If not specified, the default value is true.

Nested Components

No components may be nested inside a Jar Scan Filter element.

Special Features

No special features are associated with a Jar Scan Filter element.