loading Java classes from a signed applet -
if i'm running signed java applet, can load additional classes remote sources (in same domain, maybe same host) , run them?
i'd without changing pages or stopping current applet. of course, total size of classes large load them @ once.
is there way this? , there way signed applets , preserve "confidence" status?
i think classes lazy loaded in applets. being loaded on demand.
anyway, if classes outside of jar can use applet classloader , load them name. ex:
classloader loader = this.getclass().getclassloader(); class clazz = loader.loadclass("acme.appletaddon");
if want load classes jar think need create new instance of urlclassloader url(s) of jar(s).
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");
by default, applets forbidden create new classloaders. if sign applet , include permission create new classloaders can it.
Comments
Post a Comment