I made an applet that via reflection calls main on different classes and
redirects its output to an applets textarea:
System.setOut(MyPrintStream);
I set up my security as follow:
SecurityManager sec = System.getSecurityManager();
sec.checkPermission(new RuntimePermission("setIO"));
Still I get the Exception:
java.security.AccessControlException: access denied
(java.lang.RuntimePermission setIO)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:270)
at
java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at ConsoleToTextField.setSecurity(ConsoleToTextField.java:38)
at ConsoleToTextField.init(ConsoleToTextField.java:17)
at sun.applet.AppletPanel.run(AppletPanel.java:341)
at java.lang.Thread.run(Thread.java:536)
Does anyone know how to get around these problems ?
I think that granting the Permission in my own policy is not good enough
when people come to visit my applet on the net
and even though i did this it still dosent work :(
In the appletviewer it runs just fine!
Hope you can help me!
Jesper