如何在Firefox中添加Java applet的所有权限? [英] How to add all permissions to java applet in Firefox?
问题描述
你好,
我在notepad ++中构建java applet而不是在某些IDE中。如何为此applet提供所有权限(用于打开和写入套接字)以进行测试。我问这个是因为现在我需要每次都将applet部署到服务器上!
如果我从开发计算机运行applet并且我想连接到服务器上的socket哪个不是本地主机我得到例外。
所以我问是否有办法在浏览器中为所有或仅此applet提供所有权限?
Hello,
I''m building java applet in notepad++ not in some IDE. How can I give this applet all permissions (for opening and writting to socket) for testing. I''m asking this because now I need to deploy applet to server each time!
If I run applet from developing computer and I want to connect to socket on server which is not on localhost I get exception.
So I''m asking if there is any way to give all or only this applet all permissions in browser?
推荐答案
我正在用记事本++构建java applet而不是在某些IDE中构建
这是你的错。为什么?
在项目中添加一个policy.policy文件并输入以下内容:
I''m building java applet in notepad++ not in some IDE
There''s your fault. WHY?
Add a file "policy.policy" to the project and put in there the following:
grant {
permission java.security.AllPermission;
};
使用参数启动应用程序:
the start the app with the argument:
java -Djava.security.policy=policy.policy MyFunkyApplication
这篇关于如何在Firefox中添加Java applet的所有权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!