Documentation Contents
Java Platform, Standard Edition Deployment Guide
Contents    Previous    Next

32 Other Deployment Features

This topic provides information on additional deployment features that are supported for rich Internet applications, such as protocols, multiple JRE versions, and special applet attributes.

This topic contains the following sections:

32.1 Protocol Support

Support for the following common protocols is built into the Java Plug-in:

32.1.1 HTTP and FTP

Java Plug-in supports HTTP and FTP protocols, including built-in proxy configuration support.

32.1.2 HTTPS

HTTPS is supported in Java Plug-in through Java Secure Socket Extension (JSSE), which provides a Java implementation of SSL and HTTPS for the Java platform.

32.1.3 Socks

Java Plug-in currently supports SOCKS version 4.

Note: For HTTP/HTTPS, a SOCKS proxy server can be used with a web proxy server to add caching. The behavior, however, might differ from that observed when running a similar configuration in a browser without Java Plug-in.

32.1.4 NTLM Authentication

Java Plug-in supports NTLM authentication protocol for HTTP/HTTPS. When attempting to access a server requiring NTLM authentication, the user is prompted to enter User Name, Password and the Domain.

32.2 Multi-Version Support

The following sections describe the methods used to support multiple versions of the JRE on a single system.

32.2.1 Unique MIME Type

Every new and update version of Java Plug-in has a unique MIME type. MIME type identifies the type or version of the Java executable to be loaded and initialized by Java Plug-in. It is specified with the element type in the embed tag with Firefox and with <param name="type"> in the object tag for Internet Explorer. If you want to use a minimum version of Java Plug-in with Firefox, specify the unique MIME type in the embed tag.

The MIME type corresponding to the version of Java Plug-in installed in your computer looks like the following:


where version includes the major, minor and patch version numbers.

The Java Plug-in supports the latest MIME type version (corresponding to the version of the Java Plug-in) and all previous MIME type versions.

Other MIME types supported by the Java Plug-in look like the following:


To determine which MIME types are supported by the version of the Java Plug-in installed on your computer, enter about:plugins in the Firefox location bar. This displays a list of installed and detected plugins. Look for the Java Plug-in entry; it will list all supported MIME types. See about:plugins in the MozillaZine Knowledge Base for more information.

For Java Plug-in 1.7.0, the unique MIME type is application/x-java-applet;jpi-version=1.7.


Note: If you have different versions of the JRE installed, only the latest version of the Java Plug-in is installed. As mentioned previously, this version of the Java Plug-in supports all previous versions of the Java Plug-in MIME type. These MIME types are supported by the file npjp2.dll. The location of this file is listed in the about:plugins page.

32.2.3 Unique Java Plug-in Property File

The property file is named It is located in the following directory:

<User Application Data Folder>\Sun\Java\Deployment

<User Application Data Folder> is an application data folder specific to the user.

As an example, for a user testuser on a Windows 7 system, the value of <User Application Data Folder> would be C:\Users\testuser\AppData\LocalLow

The value of <User Application Data Folder> is obtained from the Win32 API function call SHGetFolderPath() with CSIDL_APPDATA.

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.


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 <Windows Directory>\Sun\Java\Deployment\Lib\Untrusted
Trusted JAR <Windows Directory>\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.4 Applet Persistence API

Two methods in the interface java.Applet.AppletContext enable applet persistence across browser sessions:

These methods enable you to stream data and objects from one browser session so that they can be reused in subsequent browser sessions. This provides applet persistence and makes it unnecessary to use static objects in applets for this same purpose.

The setStream(key, stream) method maps a key to a stream. The getStream(key) method returns the stream mapped to the key. If the AppletContext already has a stream mapped to the key when the setStream(key, stream) method is invoked, the mapping is updated.

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 ...>
<param name="image" value="my_image.gif">

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 ...>
<PARAM name="boxmessage" value="<your custom message goes here>">

32.5.4 Applet Attribute Precedence

The order of precedence for these attributes in applets is as follows:

  1. If no parameters are provided, the default appearance is used.

  2. If a custom graphic is specified for the image attribute, then the custom graphic appears as described for image.

  3. If custom text is provided for the boxmessage attribute, then custom text is displayed as described for boxmessage.

With any combination of image and boxmessage attributes, custom colors can always be provided with the boxbgcolor and boxfgcolor attributes.

Contents    Previous    Next

Oracle and/or its affiliates Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved.
Contact Us