开发者

how to provide access permission for applet to write on file system

I have problem in setup of policy file for applet.I am doing this first time and don't know how to set the policy file for applet in java.Actually I want to give the permission to the applet to write on the file system. for Which I will have to give file permission to the applet

So I make a file named .java.policy and and put the following code in it

grant codeBase "file:/C://res/applet/*" {
permission java.io.FilePermission "C:\\res\\applet\\test.txt", "read, write";
};

and save this in users\jindal folder now i set the JAVA_HOME as c:\users\jindal

but still I found the exception that

java.security.AccessControlException: access denied (java.io.FilePermiss开发者_开发问答ion C:\res\applet\test.txt write)

can any body please help what is wrong or what should i do


Please Go to The below link for Signing applet

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html


What URL do you put in your browser? And what is codebase on your applet tag? Maybe try first playing with codebase. First I would remove it from policy file to identify whether the problem is in code base or not.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜