必须执行哪些步骤才能获得可以使用文件的小程序?
我有一个小程序,其中包含一个函数,如果该函数由 javascript 调用,则该函数会返回所有网络驱动器的列表。
目前我收到权限被拒绝的异常。谷歌告诉我:我必须签署它并创建一个策略文件。但我没有前进。
你能告诉我步骤,如何让它工作吗?
问候和感谢!
I have an applet with a function which returns a List of all Netdrives if this function is called by javascript.
Currently I get a permission denied exception. Google told me: I have to sign it and create a policy file. But I am not getting forward.
Could you tell me the steps, how to get this working?
Greetings and thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要先对该小程序进行签名,然后才能获得访问文件的权限:
请参阅 http://java.sun.com/developer/onlineTraining/Programming/ JDCBook/signed.html
或此(较新):http:// www.entrust.net/ssl-resources/pdf/ECS_Java_Code_Signing_Guide.pdf
You need to sign the applet, before it gets permission to access files:
See http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html
or this (newer): http://www.entrust.net/ssl-resources/pdf/ECS_Java_Code_Signing_Guide.pdf
正确。
如果最终用户在出现提示时接受签名的小程序代码,则为冗余。
缺少的成分是您可能需要将这些调用包装在 AccessController.doPrivileged(PrivilegedAction)。这是与JS交互造成的。
Correct.
Redundant if the signed applet code is accepted by the end user when prompted.
The missing ingredient is that you probably need to wrap those calls in an AccessController.doPrivileged(PrivilegedAction). This is caused by the interaction with JS.