Re: Applets and custom class loaders



On Oct 16, 5:38 am, "Qu0ll" <Qu0llSixF...@xxxxxxxxx> wrote:
Is there any reason to use a custom class loader with an applet? I have an
applet in which I only want to load a particular class if the corresponding
content type is required to be rendered by that applet so that the initial
applet load is as quick as possible.

You don't need an additional class loader. Do not put the particular
class file in a Jar. Just put the class file on the server in the
right directory according to the package name. The applet will try to
load the class first time it is referenced. Since it is not in the Jar
(which has already been sent over the net) the class loader needs to
issues a new HTTP request first time the class is needed.

Of course you have to make absolutely sure the class is not referenced
before you use it. Consider programming against an interface and use
Class.forName() to load an interface implementation (your class) to
make sure you have better control over the class usage.

Then additional HTTP requests bear a certain overhead and delay and
therefore the whole idea of delayed loading a class might not be worse
it.

.



Relevant Pages

  • access HTTP request parameters?
    ... I have a rather complex 3rd party web application using Cookies ... the users browser to load an applet. ... set in the HTTP request used to load applet.jar to the client. ...
    (comp.lang.java.programmer)
  • Re: IIS Slow with little load problem
    ... Tracing on the SQL Server ... Can't you load up a local test HTML page to get the ... Applet running -- in which case, you are dealing with a local filesystem ... > IIS will likely cache access to those class files such that subsequent ...
    (microsoft.public.inetserver.iis)
  • Re: loss of data depending on security permissions
    ... > hosts the Applet. ... You don't need extra security permissions to load a URL from the server ... Save the downloaded image to a file and do a binary compare. ...
    (comp.lang.java.programmer)
  • Site crashes on Empty Applet..????
    ... customized applet I built a year ago that scrolls news items in an applet ... it takes folks 10 sec to 5 minutes to load the ... News items will continually scroll from ... not load for 5 minutes on either browser (of course, ...
    (comp.lang.java.help)
  • Re: Trying to block Intel GMA driver on the desktop.
    ... Go to Start/Run/Regedit and navigate to: ... This tweak is useful for uncluttering your Control Panel and removing unused ... Add a key named don't load. ... You will use one String value for each control panel applet you want ...
    (microsoft.public.windowsxp.general)