org.apache.jasper.servlet

Class JasperLoader

public class JasperLoader extends URLClassLoader

Class loader for loading servlet class files (corresponding to JSP files) and tag handler class files (corresponding to tag files).

Author: Anil K. Vijendran Harish Prabandham Jean-Francois Arcand

Constructor Summary
JasperLoader(URL[] urls, ClassLoader parent, PermissionCollection permissionCollection, CodeSource codeSource)
Method Summary
PermissionCollectiongetPermissions(CodeSource codeSource)
Get the Permissions for a CodeSource.
InputStreamgetResourceAsStream(String name)
Delegate to parent
ClassloadClass(String name)
Load the class with the specified name.
ClassloadClass(String name, boolean resolve)
Load the class with the specified name, searching using the following algorithm until it finds and returns the class.

Constructor Detail

JasperLoader

public JasperLoader(URL[] urls, ClassLoader parent, PermissionCollection permissionCollection, CodeSource codeSource)

Method Detail

getPermissions

public final PermissionCollection getPermissions(CodeSource codeSource)
Get the Permissions for a CodeSource. Since this ClassLoader is only used for a JSP page in a web application context, we just return our preset PermissionCollection for the web app context.

Parameters: codeSource Code source where the code was loaded from

Returns: PermissionCollection for CodeSource

getResourceAsStream

public InputStream getResourceAsStream(String name)
Delegate to parent

See Also: java.lang.ClassLoader#getResourceAsStream(java.lang.String)

loadClass

public Class loadClass(String name)
Load the class with the specified name. This method searches for classes in the same manner as loadClass(String, boolean) with false as the second argument.

Parameters: name Name of the class to be loaded

Throws: ClassNotFoundException if the class was not found

loadClass

public Class loadClass(String name, boolean resolve)
Load the class with the specified name, searching using the following algorithm until it finds and returns the class. If the class cannot be found, returns ClassNotFoundException. If the class was found using the above steps, and the resolve flag is true, this method will then call resolveClass(Class) on the resulting Class object.

Parameters: name Name of the class to be loaded resolve If true then resolve the class

Throws: ClassNotFoundException if the class was not found

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.