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.FilePermission C:\res\applet\test.txt write)
can any body please help what is wrong or what should i do
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.
Please Go to The below link for Signing applet
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html