| Links Top Level Elements Executors Connectors Containers Nested Components Cluster Elements Other | The Loader Component| Introduction |  | 
  The Loader element represents the web
  application class loader that will be used to load Java
  classes and resources for your web application.  Such
  a class loader must follow the requirements of the Servlet
  Specification, and load classes from the following locations: 
  From the /WEB-INF/classesdirectory inside your
      web application.From JAR files in the /WEB-INF/libdirectory
      inside your web application.From resources made available by Catalina to all web
      applications globally. A Loader element MAY be nested inside a Context
  component.  If it is not included, a default Loader configuration will be
  created automatically, which is sufficient for most requirements. For a more in-depth description of the class loader hierarchy
  that is implemented by Catalina, see the ClassLoader HowTo. 
    The description below uses the variable name $CATALINA_BASE to refer the
    base directory against which most relative paths are resolved. If you have
    not configured Tomcat for multiple instances by setting a CATALINA_BASE
    directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME,
    the directory into which you have installed Tomcat. | 
 | Attributes |  | 
  | Common Attributes |  | 
    All implementations of Loader
    support the following attributes: | Attribute | Description | 
|---|
 | className | Java class name of the implementation to use.  This class must
        implement the org.apache.catalina.Loaderinterface.
        If not specified, the standard value (defined below) will be used. |  | delegate | Set to trueif you want the class loader to follow
        the standard Java2 delegation model, and attempt to load classes from
        parent class loaders before looking inside the web
        application.  Set tofalse(the default) to have the
        class loader look inside the web application first, before asking
        parent class loaders to find requested classes or resources. |  | reloadable | Set to trueif you want Catalina to monitor classes in/WEB-INF/classes/and/WEB-INF/libfor
        changes, and automatically reload the web application if a change
        is detected.  This feature is very useful during application
        development, but it requires significant runtime overhead and is
        not recommended for use on deployed production applications.  You
        can use the Manager web
        application, however, to trigger reloads of deployed applications
        on demand. NOTE - The value for this property will be
        inherited from the reloadableattribute you set on
        the surrounding Context component,
        and any value you explicitly set here will be replaced. | 
 | 
 | Standard Implementation |  | 
    The standard implementation of Loader is
    org.apache.catalina.loader.WebappLoader.
    It supports the following additional attributes (in addition to the
    common attributes listed above): | Attribute | Description | 
|---|
 | loaderClass | Java class name of the java.lang.ClassLoaderimplementation class to use.  If not specified, the default value isorg.apache.catalina.loader.WebappClassLoader. Custom
        loaderClass implementations must extendorg.apache.catalina.loader.WebappClassLoader. |  | searchExternalFirst | Set to trueif you want repositories outside
        ofWEB-INF/classesandWEB-INF/libto
        be searched first. Default value isfalse. | 
 | 
 | VirtualWebappLoader Implementation |  | 
    This implementation of Loader is
    org.apache.catalina.loader.VirtualWebappLoader.
    It extends WebappLoaderand supports the following
    additional attributes | Attribute | Description | 
|---|
 | virtualClasspath | Additional repositories to search for resources.
        Multiple values can be joined using ;as a separator. Leading and trailing whitespaces in values are ignored.
        If a value does not point to an existing directory or
        *.jarfile, it is silently skipped.
        Diagnostic messages can be seen if you enable debug logging for
        the VirtualWebappLoader class. Example: virtualClasspath="${catalina.base}/myapp_config" |  | searchVirtualFirst | Set to trueif you want the virtual
        class path to be searched beforeWEB-INF/classesandWEB-INF/lib.
        Default value isfalse. If searched before, resources located in the virtual
        class path take precendence over resources with the same
        name contained in the webapp. | 
 | 
 | 
 |