alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Tomcat example source code file (loader.xml)

This example Tomcat source code file (loader.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Tomcat tags/keywords

apache, catalina, catalina_base, context, if, if, license, license, loader, loader, see, tomcat, you, you

The Tomcat loader.xml source code

<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document [
  <!ENTITY project SYSTEM "project.xml">
]>
<document url="loader.html">

  &project;

  <properties>
    <author email="craigmcc@apache.org">Craig R. McClanahan
    <title>The Loader Component
  </properties>

<body>


<section name="Introduction">

  <p>The Loader element represents the web
  application class loader</em> 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:</p>
  <ul>
  <li>From the /WEB-INF/classes directory inside your
      web application.</li>
  <li>From JAR files in the /WEB-INF/lib directory
      inside your web application.</li>
  <li>From resources made available by Catalina to all web
      applications globally.</li>
  </ul>

  <p>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.</p>

  <p>For a more in-depth description of the class loader hierarchy
  that is implemented by Catalina, see <a href="../class-loader-howto.html">the ClassLoader HowTo.

<blockquote> <p>The description below uses the variable name $CATALINA_HOME to refer to the directory into which you have installed Tomcat 6, and is the base directory against which most relative paths are resolved. However, if you have configured Tomcat 6 for multiple instances by setting a CATALINA_BASE directory, you should use $CATALINA_BASE instead of $CATALINA_HOME for each of these references.</p> </em> </section> <section name="Attributes"> <subsection name="Common Attributes"> <p>All implementations of Loader support the following attributes:</p> <attributes> <attribute name="className" required="false"> <p>Java class name of the implementation to use. This class must implement the <code>org.apache.catalina.Loader interface. If not specified, the standard value (defined below) will be used.</p> </attribute> <attribute name="delegate" required="false"> <p>Set to true if you want the class loader to follow the standard Java2 delegation model, and attempt to load classes from parent class loaders <strong>before looking inside the web application. Set to <code>false (the default) to have the class loader look inside the web application first, before asking parent class loaders to find requested classes or resources.</p> </attribute> <attribute name="reloadable" required="false"> <p>Set to true if you want Catalina to monitor classes in <code>/WEB-INF/classes/ and /WEB-INF/lib for 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 <a href="../manager-howto.html">Manager web application, however, to trigger reloads of deployed applications on demand.</p> <p>NOTE - The value for this property will be inherited from the <code>reloadable attribute you set on the surrounding <a href="context.html">Context component, and any value you explicitly set here will be replaced.</p> </attribute> </attributes> </subsection> <subsection name="Standard Implementation"> <p>The standard implementation of Loader is <strong>org.apache.catalina.loader.WebappLoader. It supports the following additional attributes (in addition to the common attributes listed above):</p> <attributes> <attribute name="loaderClass" required="false"> <p>Java class name of the java.lang.ClassLoader implementation class to use. If not specified, the default value is <code>org.apache.catalina.loader.WebappClassLoader.

</attribute> </attributes> </subsection> </section> <section name="Nested Components"> <p>No components may be nested inside a Loader element.

</section> <section name="Special Features"> <subsection name="Logging"> <p>A loader is associated with the log category based on its classname.

</subsection> </section> </body> </document>

Other Tomcat examples (source code examples)

Here is a short list of links related to this Tomcat loader.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.