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?