File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Applets - 1.2 (again) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Applets - 1.2 (again)" Watch "Applets - 1.2 (again)" New topic

Applets - 1.2 (again)

Bil Bob
Ranch Hand

Joined: Dec 24, 2004
Posts: 36
Hi folks,

Please, I just want to get a final answer (as I am not 100% sure). Is this TRUE:
An applet started on a LOCAL machine as of 1.2 will NOT have automatic access to "the list of goodies" (like files, all properties etc)...instead it has to (just like applets run on ANOTHER machine) be granted access via a security policy
I have read so many sources saying different things (java tut Vs people's answers Vs FAQ)

That is to say,
"Does it or does it not have default access to everything."

I am also presuming that remote code no longer gets "placed immediately in the sandbox". Instead, it gets access based on security policy.

I really appreciate any clarification here!

Thanks in advance

SCJP, SCWCD, SCBCD, almost SCEA<br />... and a real developer too ;)
Bil Bob
Ranch Hand

Joined: Dec 24, 2004
Posts: 36
anyone know? sorry for the long winded questions

i would really apppreciate some help!
John Alden

Joined: Jan 09, 2004
Posts: 7
An applet is limited to the security manager within the browser. It does not automatically have access to external browser resources such as network, printers, files system, file servers, etc.

You can however sign your applet so it is trusted by the browser. A trusted applet has access to to the file system, etc.
Steven Wong
Ranch Hand

Joined: Mar 07, 2002
Posts: 295

One of the SCEA books I read mentions that the Java applet can read / write files
onto the machine that it is connected to. Further to that, the following files are in no way accessible by the applet:

1. java.home
2. java.class.path
4. user.home
5. user.dir

I hope the above is correct.

best regards,<br />Steven<br />SCJP, SCEA
Bil Bob
Ranch Hand

Joined: Dec 24, 2004
Posts: 36
thanks for help guys

some of the scea-j2ee files are also pretty good out there to for an explanation. never had to program applets since university days so its all been a bit foreign to me.

Have a nice day
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183
John is right.

If you want more information about the subject you can look at a similar discussion at -

Some information from this thread:

Java Security Manager is not installed by default for usual Java apps, but for applets the situation is opposite:

A browser may only have one security manager. The security manager is established at startup, and it cannot thereafter be replaced, overloaded, overridden, or extended. Applets cannot create or reference their own security manager.

JDK 1.0 Security Model:

JDK 1.1 introduced the concept of a "signed applet," as illustrated in the next figure. A digitally signed applet is treated like local code, with full access to resources, if the public key used to verify the signature is trusted. Unsigned applets are still run in the sandbox. Signed applets are delivered, with their respective signatures, in signed JAR (Java ARchive) files.


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183
Listen to this:

JDK 1.2 introduces a number of improvements over JDK 1.1. First, all code, regardless of whether it is local or remote, can now be subject to a security policy. The security policy defines the set of permissions available for code from various signers or locations and can be configured by a user or a system administrator. Each permission specifies a permitted access to a particular resource, such as read and write access to a specified file or directory or connect access to a given host and port..

I agree. Here's the link:
subject: Applets - 1.2 (again)
It's not a secret anymore!