All right, so I've got an applet I'm trying to embed into an HTML page and it's throwing:
AccessControlException: access denied (java.net.SocketPermission someTarget connect, resolve)
This is fine; I know that the fix for this is either:
grant {
permission java.net.SocketPermission "someTarget", "connect, resolve";
};
Or
SocketPermission p1= new SocketPermission("someTarget", "connect,resolve");
What I want to know is this: Which of these two things do I need, and where in my code should I put this?
I suggest to connect back to the same host from which the applet was downloaded, this is allowed by Java security manager. The host should be exactly the same. Editing permission policy file will get you nowhere, since you will have to do it on every computer where you want the applet to run