aspose file tools*
The moose likes Applets and the fly likes Preloading applet classes from a signed jar? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Preloading applet classes from a signed jar?" Watch "Preloading applet classes from a signed jar?" New topic
Author

Preloading applet classes from a signed jar?

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
I have an applet (called MainApplet) located at applet.htm. The applet takes a while to load...

Before reaching that page, the user first goes to index.htm.

In index.htm, I want to preload the applet classes.

One method I've seen is to deploy a PreLoaderApplet within index.html that uses Class.forName() to preload the MainApplet classes.

The jar that the two applets are in must be signed, but I don't want the user to be presented with the security certificate when he first gets to index.html.

So is there any way I can preload the classes without the user being asked to accept a security certificate?

Thanks in advance,
James
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
I'm wondering why the applets should be signed? Will it be because you are using the Class.forName() method?

If so you can load all classes manually by manually refering them:

So instead of doing this: Class.forName("com.test.PreloadedClass");
You could do this: com.test.PreloadedClass.class.getName();
It should also load the class and no special security requirements are made.

But once again. I'm not sure why you need to sign the applet so maybe this is not the solution for this problem!
Let me know if it works for you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Preloading applet classes from a signed jar?