--- java/org/apache/catalina/loader/WebappClassLoader.java (revision 1201431) +++ java/org/apache/catalina/loader/WebappClassLoader.java (working copy) @@ -86,14 +86,16 @@ * compatible with a normal URLClassLoader, although its internal * behavior may be completely different. *

- * IMPLEMENTATION NOTE - This class loader faithfully follows + * IMPLEMENTATION NOTE - By default, this class loader faithfully follows * the delegation model recommended in the specification. The system class * loader will be queried first, then the local repositories, and only then * delegation to the parent class loader will occur. This allows the web * application to override any shared class except the classes from J2SE. * Special handling is provided from the JAXP XML parser interfaces, the JNDI * interfaces, and the classes from the servlet API, which are never loaded - * from the webapp repository. + * from the webapp repository. The delegate property + * allows an application to modify this behavior move the parent class loader + * ahead of the local repository. *

* IMPLEMENTATION NOTE - Due to limitations in Jasper * compilation technology, any repository which contains classes from @@ -292,7 +294,8 @@ * usual Java2 delegation model)? If set to false, * this class loader will search its own repositories first, and * delegate to the parent only if the class or resource is not - * found locally. + * found locally. Note that the default, false, is + * the behavior called for by the servlet specification. */ protected boolean delegate = false; @@ -536,6 +539,14 @@ /** * Set the "delegate first" flag for this class loader. + * If this flag is true, this class loader delegates + * to the parent class loader + * before searching its own repositories, as + * in an ordinary (non-servlet) chain of of Java class loaders. + * If set to false, + * this class loader will search its own repositories first, and + * delegate to the parent only if the class or resource is not + * found locally, as per the servlet specification. * * @param delegate The new "delegate first" flag */