问题
In Java JApplet, file read and write operations did not work in webrowser. When I click "Ok" button, it should be write some file in our local path. But it shows below error. How to resolve this error?
java.security.AccessControlException: access denied (
"java.io.FilePermission" "D:/.../.html" "write")
回答1:
By default whenever a applet tries to access local resources, its denied as a part of security layer. You have following options if you need to access using applet:
- Sign your applet using any signing mechanism and then publish,
- ( though this one is not a useful and recommended way of doing this.)Change the security settings on the computer where the applet is executing.
来源:https://stackoverflow.com/questions/10102217/how-can-an-applet-read-write-files-on-the-local-file-system