Loading Java classes from a signed applet

If I run a signed Java applet, can I download additional classes from remote sources (in the same domain, maybe even with the same host) and run them?

I would like to do this without changing pages or even stopping the current applet. Of course, the total size of all classes is too large to load them all at once.

Is there any way to do this? And is there a way to do this with signed applets and maintain their trust status?

+5
source share
3 answers

I think classes are lazy loading into applets. loaded on demand.

, , . :

ClassLoader loader = this.getClass().getClassLoader();
Class clazz = loader.loadClass("acme.AppletAddon");

jar, , URLClassLoader URL- (-) .

URL[] urls = new URL[]{new URL("http://localhost:8080/addon.jar")};
URLClassLoader loader = URLClassLoader.newInstance(urls,this.getClass().getClassLoader());
Class clazz = loader.loadClass("acme.AppletAddon");

. , .

+5

, URL- , . URL- HTTP, ( ) . , .

, , , , . , , , , .

, .

+2

, ( ). (RMI)?

0

All Articles