How to load signed applet from local disc with full permissions?

1.9k Views Asked by At

I have an application where javascript code is accessing java applet methods that write on local disk (just to note - this is not directly possibly, but there is a workaround for it that enables to do so). Applet is self-signed applet, so users have to allow it to run first.

If applet's codebase is set to "http://..." everything works fine, in FF, Chrome and Opera as well. However, I would like to put this applet on local file system. However, if I use codebase "file://..." (I also tried to not use codebase at all and write directly full jar path to archive) it does not work, applet does not load with Warning-Security pop-up that enable user to allow running the applets.

I only tested it in FF (3.6.1.4) so far, Java version is 1.6.0.21.

Are signed applets limited only for HTTP use? Or is there some workaround?

2

There are 2 best solutions below

1
On

..is there some workaround?

Perhaps using the JNLP API services in an unsigned applet will work better. I have a demo. of the JNLP FileContents object.

For details on using the JNLP services in an embedded applet see the links to the 'next generation plug-in' in the applet information page.

0
On

Applets loaded from the local filesystem are allowed to write files only in, or below, the directory containing the applet. So, if the applet is in C:\MyProjects\MyAppletTest it will be able to read and write files in that directory and its subdirectories, but not in C:\MyProjects. You can override this behavior with a policy files as explained in Quick Tour of Controlling Applets