Overview of Applets |
For security reasons, an applet that's loaded over the network has the following restrictions:
- It can't load libraries or define native methods.
- It can't ordinarily read or write files on the host that's executing it.
- It can't make network connections except to the host that it came from.
- It can't start any program on the host that's executing it.
- It can't read every system property.
- Windows that an applet brings up are distinguished by some warning text and either a colored bar or an image, so that the windows don't look like they're part of a trusted application.
Things that applets can do, that you might not expect:
- Applets that are loaded from the local file system (from a directory in the user's CLASSPATH [or from a file URL?]) have none of the restrictions that applets loaded over the network do (as listed above). For this reason, some browsers don't allow applets to be loaded via file: URLs.
- Although most applets stop running once you leave their page, they don't have to.
Each browser has a SecurityManager object that checks for applet security violations. When a SecurityManager detects a violation, it throws a SecurityException. [ need an example applet that tries to do a few forbidden things ]
Overview of Applets |