Applet_01
"Properties" are Java's (platform-independent) equivalent to "environment
variables". "Applet_01" looks for predefined "system properties" and finds
out which of them are accessible from within an applet.
Please, also consider my "Hints for Reading"
and the "List of Recent Changes"!
|
The applet on the left side shows a list of
property_name=property_value pairs. Some properties are
"(unavailable)" which means that these items don't exist, others are
"(inaccessible)" which means that they cannot be accessed from within an
applet.
The actual contents may depend on whether an appletviewer or a web browser
is used to execute the applet. |
System Properties
When started, a java interpreter (or web browser) predefines a set of "standard
system properties" which can then be examined from within an applet or an
application. While applications may create new properties and modify existing
ones, applets have only limited access.
A typical output (produced by an applet running inside an appletviewer) might
look as follows:
-
java.version = "1.0.2"
-
java.vendor = "Sun Microsystems Inc."
-
java.vendor.url = "http://www.sun.com"
-
java.home = "c:\Programme\Java\bin\.."
-
java.class.version = "45.3"
-
java.class.path = ".;c:\Programme\Java\lib\classes.zip"
-
os.name = "Windows 95"
-
os.arch = "x86"
-
os.version = "4.0"
-
file.separator = "\"
-
path.separator = ";"
-
line.separator = "\n"
-
user.name = "Rozek"
-
user.home = "c:\Programme\Java"
-
user.dir = "c:\Rozek\Java\Applets\Applet_01"
-
awt.toolkit = "sun.awt.win32.MToolkit"
-
awt.appletWarning = (unavailable)
-
acl.read = "+"
-
acl.read.default = ""
-
acl.write = "+"
-
acl.write.default = ""
-
appletviewer.security.model = (unavailable)
-
firewallHost = "sunweb.ebay"
-
firewallPort = "80"
-
firewallSet = "true"
-
package.restrict.access.java = (unavailable)
-
package.restrict.access.sun = "true"
-
package.restrict.definition.java = "true"
-
package.restrict.definition.sun = "true"
-
proxyHost = (unavailable)
-
proxyPort = (unavailable)
-
proxySet = (unavailable)
Unfortunately, an applet is not allowed to create a list of available system
properties using the getProperties method - the SecurityManager
prohibits this call. As a consequence, the "standard" set had to be explicitly
coded into "Applet_01".
Source Code
The source code of this applet is available for download:
|