美国一级毛片a a黑人,日韩av白人无码高清,欧美强奸一区在线观看,手机A V东京热A V丝袜美腿

The Resources Component

Table of Contents

Introduction

The Resources element represents all the resources available to the web application. This includes classes, JAR files, HTML, JSPs and any other files that contribute to the web application. Implementations are provided to use directories, JAR files and WARs as the source of these resources and the resources implementation may be extended to provide support for files stored in other forms such as in a database or a versioned repository.

Resources are cached by default. Caching may be controlled by configuring the appropriate caching attributes on the containing Context.

Note: Running a webapp with non-filesystem based Resources implementations is only possible when the webapp does not rely on direct filesystem access to its own resources, and uses the methods in the ServletContext interface to access them.

A Resources element MAY be nested inside a Context component. If it is not included, a default filesystem based Resources will be created automatically, which is sufficient for most requirements.

Attributes

Common Attributes

All implementations of Resources support the following attributes:

Attribute Description
className

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

Standard Implementation

The standard implementation of Resources is org.apache.catalina.webresources.StandardRoot, and is configured by its parent Context element.

Nested Components

A web application's main resources are defined by the docBase defined for the Context. Additional resources may be made available to the web application by defining one or more nested components.

PreResources

PreResources are searched before the main resources. They will be searched in the order they are defined. To configure PreResources, nest a <PreResources> element inside the <Resources> element with the following attributes:

Attribute Description
base

Identifies where the resources to be used are located. This attribute is required by the org.apache.catalina.WebResourceSet implementations provided by Tomcat and should specify the absolute path to the file, directory or JAR where the resources are located. Custom implementations may not require it.

className

Java class name of the implementation to use. This class must implement the org.apache.catalina.WebResourceSet interface. Tomcat provides three standard implementations: org.apache.catalina.webresources.DirResourceSet, org.apache.catalina.webresources.FileResourceSet and org.apache.catalina.webresources.JarResourceSet. Custom implementations may also be used.

internalPath

Identifies the path within the base where the resources are to be found. This is typically only used with JAR files when the resources are not located at the root of the JAR as is the case with resource JARs. This attribute is required by the org.apache.catalina.WebResourceSet implementations provided by Tomcat and must start with '/'. Custom implementations may not require it. If not specified, the default value '/' will be used.

webAppMount

Identifies the path within the web application that these resources will be made available. For the org.apache.catalina.WebResourceSet implementations provided by Tomcat, this attribute is required and must start with '/'. Custom implementations may not require it. If not specified, the default value of '/' will be used.

JAR resources

JarResources are searched after the main resources but before the PostResources. They will be searched in the order they are defined. To configure JarResources, nest a <JarResources> element inside the <Resources> element. The configuration attributes are the same as for PreResources.

Post-resources

PostResources are searched after the resource JARs. They will be searched in the order they are defined. To configure PostResources, nest a <PostResources> element inside the <Resources> element. The configuration attributes are the same as for PreResources.

Special Features

No special features are associated with a Resources element.

Comments

Notice: This comments section collects your suggestions on improving documentation for Apache Tomcat.

If you have trouble and need help, read Find Help page and ask your question on the tomcat-users mailing list. Do not ask such questions here. This is not a Q&A section.

The Apache Comments System is explained here. Comments may be removed by our moderators if they are either implemented or considered invalid/off-topic.