Date: Mon, 12 May 1997 14:11:05 -0700
Message-Id: <199705122111.OAA19151@puffin.eng.sun.com>
From: Marianne Mueller <mrm@Eng>
To: LucLaf@aol.com
Subject: Re: Define and use a ClassLoader in an applet
Hi,
The classloader used to load applets into a Java-enabled browser is
the AppletClassLoader that is created and controlled by the browser.
Generally speaking, you can't use your own classloader in the applet
environment. For more info on the applet security model, check out
http://java.sun.com/sfaq/ and also http://java.sun.com/security.
One of the restrictions placed on downloaded applets is that they
can't create a classloader that the system would then use in place of
the system's classloader. You can always create the object, but, you
can't make the browser use it, in place of its own classloader.
Also, you can't override or extend the AppletClassLoader that is
already in place.
We know that people want more flexibility with downloaded applets, and
for the next release, we are working on the infrastructure that would
allow more flexibility. See http://java.sun.com/security/handout.html
for a brief summary of features.
Marianne
> But when I use [my own classloader] with a browser (netscape 2.01 / IE3.0) via HTTP server, a
> security exception is thrown.
> This exception appear when the SpecialClassLoader constructor is invoked.
>
> Then, before invoke this constructor, I test if I can do that with the
> checkCreateClassLoader()
> method of default SecurityManager.
> This don't throw exception, then I conclued I can define a new class loader.