简体   繁体   English

如何解决java.security.AccessControlException?

[英]How to solve java.security.AccessControlException?

I am trying to access client's temp directory through my applet on my web project. 我试图通过我的Web项目上的applet访问客户端的临时目录。
When I run the applet by itself, it gets the tempdir with no problem. 当我自己运行小程序时,它毫无问题地获得了tempdir

When I try to get it on my project using javascript and calling the applet method, I am having accessControlException on my javascript console. 当我尝试使用javascript并调用applet方法在我的项目上获取它时,我的javascript控制台上出现了accessControlException Also I am getting the same exception when I try to read a file under the temp directory. 当我尝试读取temp目录下的文件时,我也遇到同样的异常。

This is what I see exactly: 这正是我所看到的:

java.security.accesscontrolexception access denied (java.util.propertypermission java.io.tmpdir read)
java.security.accesscontrolexception access denied (java.io.filepermission read)

How to solve java.security.AccessControlException ? 如何解决java.security.AccessControlException

最简单的解决方案是对applet进行签名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM