tags:

views:

326

answers:

2

I'm writing my own Java applet that can write to /tmp on my local unix machine. this applet is only going to run on a html page, inside my machine only. No server involved.

But when I try to open my page inside Firefox, the applet doesn't seem to work at all. I don't understand why, since all the .class, .html and .jar files are on the same directory.

Need help.

A: 

I don't know very much about applets, but I remember that one basic constraint is that they can't access the local filesystem.

If you want to do that one good option is to use Javascript. EDIT: But it will not work directly!

Pablo Rodriguez
JavaScript isn't going to be able to access the local file system either!
Tom Hawtin - tackline
You're right! Sorry for my mistake.
Pablo Rodriguez
A: 

A normal applet can't access the filesystem, as they are by default not trusted.
To enable filesystem access and other things (like native librarys) for an applet it has to be signed.
When a signed applet is loaded into the browser the first time, a notification pops up requesting the user to confirm that the applets signature is trusted. More information here.

josefx
If you don't understand Java security, signing class files is, in my opinion, an incredible bad thing.
Tom Hawtin - tackline
@Tom Hawtin im sorry if my suggestion is wrong, I only remember that unsigned applets do not have any access to the local filesystem and that only signed applets get access. Which is not a security problem if you write the applet yourself, as karipappp apparently does.
josefx
yes.. im writing my own applet. now im still learning how to selfsign it. my applet will only run on my local machine only, one single isolated machine with a browser to surf a local html files. thats all.
karipappp
The question isn't about the applet accessing the file system, it's about the applet itself being loaded from the file system (as opposed to a web server).
Dan Dyer