Sun GlassFish Enterprise Server v3 Application Deployment Guide

class-loader

Configures the class loader for the web module.

Superelements

sun-web-app (sun-web.xml)

Subelements

The following table describes subelements for the class-loader element.

Table C–22 class-loader Subelements

Element 

Required 

Description 

property (with attributes)

zero or more 

Specifies a property, which has a name and a value. 

Attributes

The following table describes attributes for the class-loader element.

Table C–23 class-loader Attributes

Attribute 

Default 

Description 

extra-class-path

null 

(optional) Specifies a colon or semicolon separated list of additional classpaths for this web module. Paths can be absolute or relative to the web module's root, for example: 

extra-class-path="WEB-INF/lib/extra/extra.jar"

delegate

true

(optional) If true, the web module follows the standard class loader delegation model and delegates to its parent class loader first before looking in the local class loader. You must set this to true for a web module that accesses EJB components or that acts as a web service client or endpoint.

If false, the web module follows the delegation model specified in the Servlet specification and looks in its class loader before looking in the parent class loader. It’s safe to set this to false only for a web module that does not interact with any other modules.

For a number of packages, including java.* and javax.*, symbol resolution is always delegated to the parent class loader regardless of the delegate setting. This prevents applications from overriding core Java runtime classes or changing the API versions of specifications that are part of the Java EE platform.


Note –

For this release, the delegate value is ignored and assumed to be set to true.


dynamic-reload-interval

 

(optional) Not implemented. Included for backward compatibility with previous Sun GlassFish Web Server versions. 


Note –

If the delegate element is set to false, the class loader delegation behavior complies with the Servlet 2.4 specification, section 9.7.2. If set to its default value of true, classes and resources residing in container-wide library JAR files are loaded in preference to classes and resources packaged within the WAR file.

Portable programs that use this element should not be packaged with any classes or interfaces that are a part of the Java EE specification. The behavior of a program that includes such classes or interfaces in its WAR file is undefined.


Properties

The following table describes properties for the class-loader element.

Table C–24 class-loader Properties

Property 

Default 

Description 

ignoreHiddenJarFiles

false

If true, specifies that all JAR and ZIP files in the WEB-INF/lib directory that start with a period (.) are ignored by the class loader.