-
Applet problems
I have designed an applet which takes an address from a textfield and trys to match it with a list of addresses in a .txt file(address.txt) located in the same directory from which the applet was launched (via of course an html page on my web).
The problem is, I keep getting a IOEXCEPTION, which i believe is related to a SECURITY problem...
because when I try to view the html page and run the applet from Internet Explorer from my home computer, i get a Com.ms.security.SecurityAccess error
when I upload it to my website, (running unix), i simply get a
IOEXCEPTION error.....
So, how do I resolve this security problem? The .txt file is located in the same directory as the applet, so shouldn't it automatically have access to it?
Please help and explain to a newbie.
-
I am using this code:
RandomAccessFile f = new RandomAccessFile("address.txt","r");
Now, if run from a user from his home, will this
try to create a new file on his temp directory?
If so, how do i make the applet access the file on my
website ...
-
I suspect that you have run afoul of the security manager. It could be the result of using a RandomAccessFile. Im pretty sure that is causing the conflict. I know Byte array streams and piped streams work without limitation in applets.
-
So say i convert the strings into a bytearraystream, how do I write and read that to a file?