Other Deployment Features (original) (raw)
32.3 System-Wide Repository (Windows only)
Previously, when a new JRE was installed, JAR and native libraries for the old release were not visible to the new one. Thus applications and applets that relied on those libraries would not work, and developers were forced to redeploy their libraries to the new JRE. The System-Wide Repository is the solution to that problem. It provides a global or system-wide location where the VM can search for libraries, JAR or native, independent of the JRE location. It provides functionality similar to the repository in the Microsoft VM.
Note:
The system-wide repository is supported by Java Plug-in only on Windows.
The table below shows the location of the new System-Wide Repository:
Type of Library | System-Wide Location |
---|---|
DLL | Any directory in the System Path environment variable. |
Untrusted JAR | \Sun\Java\Deployment\Lib\Untrusted |
Trusted JAR | \Sun\Java\Deployment\Lib\Trusted |
<Windows Directory>
is the Windows OS directory on the drive where Windows was installed (also called %SystemRoot%
).
For example, on Windows 7, where Windows has been installed on the C drive (typical), the locations of these libraries would be as follows:
Type of Library | System-Wide Location |
---|---|
DLL | Any directory in the System Path variable; e.g., C:\WINDOWS\repository if C:\WINDOWS\repository has been set in the System Path variable. |
Untrusted JAR | C:\WINDOWS\Sun\Java\Deployment\Lib\Untrusted |
Trusted JAR | C:\WINDOWS\Sun\Java\Deployment\Lib\Trusted |
The classes in the JAR files from the system-wide trusted repository are loaded by the extension class loader, whereas the classes in the JAR files from system-wide untrusted repository are loaded by the applet class loader. Thus the former classes are given the AllPermission
permissions, while the latter are given only default applet permissions.
The system-wide trusted repository implementation is based on the system property java.ext.dirs
. If users select their own java.ext.dirs
system property via the Java Control Panel, the JAR files in the system-wide trusted repository will not be loaded by Java Plug-in.
The repository does not provide version or name spaces control. It is up to the deployer to avoid version and name spaces conflicts at deployment time.
32.5 Special Applet Attributes
Applets have default attributes associated with them. Special attributes like image
and boxmessage
can be associated with applets and used for customizing the applet window during downloading of an applet. JavaBeans component can also be customized using these special attributes.
32.5.1 image
The image
attribute allows you to replace the default animation with a custom graphic. The format with the standard applet
element is:
<applet ...>
See Using applet, object and embed Tags in Java Plug-in for how this would be mapped to the object
or the embed
tags.
If a custom graphic is specified, it should be the same size as the area of the applet window. If these sizes do not match, the graphic will be placed in the upper left corner of the area specified for applet. If it is larger than the applet window, part of it will get chopped off. If it is smaller than the applet window, white, or whatever color is specified for boxbgcolor
, will appear around it.
The image can be either a GIF or JPEG, and it should reside in the same directory where other resources for the applet reside; i.e., if the applet uses the codebase
attribute, then this image should be in the codebase
directory.
Note: The image file should not be in a packaged jar file with other applet resources, since the image needs to be displayed while downloading resources.
The status bar of the browser will display "Loading Java Applet ...
" when the mouse is pointed at the applet window.
32.5.2 boxmessage
With the boxmessage
attribute you can customize the text displayed in the status bar of the browser. This attribute will be in effect when image
attribute is used. The format for using this with the standard APPLET
element is:
<APPLET ...>
32.5.3 boxbgcolor, boxfgcolor
These attributes can be used to customize colors in the applet window.
These attributes will be in effect when the image
attribute is used. Custom colors cannot be specified for the default appearance of the applet viewing area.
By default the applet window background color is white. The attribute boxbgcolor
can be used to specify a different background color. The format for use with the standard APPLET
element is:
<APPLET ...>
where <value>
may be:
- any
Color
fromjava.awt.Color
; r,g,b
wherer
,g
, andb
are integers in the range of0-255
that would render an opaque standard RGB (sRGB) color in theColor
constructorColor(int r, int g, int b)
;- standard HTML colors: silver, green, maroon, purple, navy, teal, and olive; or
- hexadecimal color format
Examples of each item above:value="cyan"
, value="111,222,145"
, value="silver"
, value="#33FF33"
By default the applet window foreground color is black. The attribute boxfgcolor
can be used to specify a different foreground color. The color values are the same as described above. The format for use with the standard APPLET
element is:
<APPLET ...>