0

When I run my html page from the local directory E:/ForSteven/PDBModels/pages/2FFU.html it works properly when I place the applet jar files with the html and say codebase="."

It also works when the pages are in a subdirectory of the jarfiles - say the code is at E:/applet/code the page is in E:/applet/code/pages and the data is in E:/applet/code/data - that is both page and data are subdirectories of the code and codebase=".." and the file is ../data/mydata.txt

However if the code is in E:/applet/code , the page is in E:/applet/pages and the data is in E:/applet/data and the codebase="../code"

then I get

java.security.AccessControlException: access denied (java.io.FilePermission E:\applet\data\data/mydata.txt read)

I am on a Windows 7 box my applet tag looks like this

<applet name="flash" code="JmolApplet" archive="JmolApplet.jar"
    codebase="../code"
    width="500" height="420" align="center" mayscript="true">
 ...
1
  • Given all the File paths, why use an applet at all? An application with no security manager would make more sense. Jun 29, 2012 at 4:11

1 Answer 1

1

please read What Applets Can and Cannot Do

Unsigned applets cannot perform the following operations:

  • They cannot access client resources such as the local filesystem, executable files, system clipboard, and printers.
  • They cannot connect to or retrieve resources from any third party server (any server other than the server it originated from).
  • They cannot load native libraries.
  • They cannot change the SecurityManager.
  • They cannot create a ClassLoader.
  • They cannot read certain system properties. See System Properties for a list of forbidden system properties.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.