How can an applet Read/Write files on the local file-system?

ε祈祈猫儿з 提交于 2019-12-18 09:56:27

问题


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:

  1. Sign your applet using any signing mechanism and then publish,
  2. ( 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!