Sun GlassFish Enterprise Server v3 Prelude Developer's Guide

Class Loader Delegation

The Servlet specification recommends that a web application class loader look in the local class loader before delegating to its parent. To make the web application class loader follow the delegation model in the Servlet specification, set delegate="false" in the class-loader element of the sun-web.xml file. It’s safe to do this only for a web module that does not interact with any other modules.

The default value is delegate="true", which causes the web application class loader to delegate in the same manner as the other class loaders. Use delegate="true" for a web application that accesses EJB components or that acts as a web service client or endpoint. For details about sun-web.xml, see Sun GlassFish Enterprise Server v3 Prelude Application Deployment Guide.


Note –

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


For general information about class loaders, see Chapter 2, Class Loaders.