Hi,
I have a simple applet based on this code:
|
Code:
|
import java.awt.*;
import java.applet.*;
import java.util.*;
import java.io.*;
public class TestJavaXp extends Applet{
int i = 0;
String s = "Print this text";
try {
FileWriter out = new FileWriter("LPT1");
out.write(s);
out.flush();
out.close();
}
catch (IOException e) {
e.printStackTrace();
}
} |
I signed the applet, I accepted the certification pop-up, but I receive this error:
uncaught exception: Error calling method on NPObject!
[plugin exception: java.security.AccessControlException: access denied (java.ioFilePermission LPT1 write)]
It works perfectly only if I grant permissions in the java.policies file, but I can't always do it of course.
Why?
I've no problem signing applets that write files on disk, I've troubles only with LPT1 port but I need it.
I tried different browsers (Firefox 3, Chrome 2, IE7).
Can anyone help me?
Thanks.