如何解决java.security.AccessControlException? [英] How to solve java.security.AccessControlException?
问题描述
我正在尝试通过我的 web 项目上的小程序访问客户端的临时目录.
当我自己运行小程序时,它会毫无问题地获取 tempdir
.
I am trying to access client's temp directory through my applet on my web project.
When I run the applet by itself, it gets the tempdir
with no problem.
当我尝试使用 javascript 并调用小程序方法在我的项目中获取它时,我的 javascript 控制台上出现 accessControlException
.当我尝试读取临时目录下的文件时,我也遇到了同样的异常.
When I try to get it on my project using javascript and calling the applet method, I am having accessControlException
on my javascript console. Also I am getting the same exception when I try to read a file under the temp directory.
这正是我所看到的:
java.security.accesscontrolexception access denied (java.util.propertypermission java.io.tmpdir read)
java.security.accesscontrolexception access denied (java.io.filepermission read)
如何解决java.security.AccessControlException
?
推荐答案
最简单的解决方案就是签署小程序.
Simplest solution is just to sign the applet.
这篇关于如何解决java.security.AccessControlException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!