Solaris Java Plug-in User's Guide

Java Plug-in in Internet Explorer on Microsoft Windows Platforms

To use Java Plug-in with Internet Explorer on Microsoft Windows platforms, use the OBJECT tag. The following is an example of mapping an APPLET tag to a Java Plug-in tag:

Original APPLET Tag


<APPLET code="XYZApp.class" codebase="html/" align="baseline"
          width="200" height="200">
       <PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
          No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
       </APPLET>

Note –

The URL given in the codebase attribute in this and following examples is for illustrative purposes only. No cab file actually exists at that URL.


New OBJECT Tag


<OBJECT classid="clsid:CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA"
width="200" height="200" align="baseline" 
codebase="http://java.sun.com/jpi/jinstall-14-win32.cab#Version=1,4,0,mn">
<PARAM NAME="code" VALUE="XYZApp.class">
<PARAM NAME="codebase" VALUE="html/">
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
<PARAM NAME="scriptable" VALUE="true">
		No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
       </OBJECT>

Note that the OBJECT tag contains similar information to the APPLET tag. It is sufficient to launch Java Plug-in in Internet Explorer. The classid in the OBJECT tag is the class identifier for Java Plug-in itself. This class identifier should be the same in every HTML page. When Internet Explorer renders this class identifier in the OBJECT tag, it will try to load Java Plug-in into the browser.

There are several attributes in the OBJECT tag, such as width, height and align, that are mapped directly from the corresponding attributes in the APPLET tag. These contain formatting information that Internet Explorer will use to position Java Plug-in. Since this information is mapped directly without changes, the position and appearance of the applets using Java Plug-in should be the same as those applets using the APPLET tag.

Not all attributes in the APPLET tag can be mapped to the OBJECT tag attributes. For example, the attributes code and codebase in the APPLET tag are not mapped into the OBJECT tag attribute. Instead, the attribute code is mapped into the PARAM code because, according to the HTML specification, the attribute code does not exist in the OBJECT tag. There are other attributes that do not correspond in the OBJECT tag attributes. These attributes, with one exception, should be mapped to PARAM tags.


Note –

Duplicate parameter names should never be used with the OBJECT tag.


The one exception is the codebase attribute. In the APPLET tag, the codebase attribute represents the location from which to download additional class and jar files. However, in the OBJECT tag, the codebase attribute represents the location from which to download Java Plug-in when it is not found on the local machine. Because the codebase attribute has two different meanings in the APPLET and OBJECT tags, you must resolve this conflict by mapping this attribute into a PARAM codebase in the OBJECT tag.

In the above example, the code and codebase attributes in the APPLET tag are mapped into the OBJECT tag parameters. The PARAM code identifies the applet, and its value should be the same as the code attribute in the APPLET tag. The PARAM codebase identifies the codebase of the applet. Java Plug-in knows where to download the applet because it can read this information from the parameters. The parameter type is not mapped from the APPLET tag, but it is required in the OBJECT tag. It identifies the type of the Java executable, such as an applet, so Java Plug-in knows how to initialize the Java executable. These three PARAM tags (code, codebase, and type) in the above example are specified by Java Plug-in. They do not exist in the PARAM of the original APPLET tag. Note that the model parameter within the OBJECT tag is identical to the model parameter inside the APPLET tag. Except for these first three parameters specified for Java Plug-in, the remainder of the parameters are the same as those inside the APPLET tag.

A new addition for Java Plug-in 1.3 (and valid in 1.4) was the PARAM scriptable tag. This was added to improve performance of applets that do not require the use of JavaScript or VBScript. The value should be true if the applet requires scripting support and false if it does not. The value is false by default.

Please note that PARAM scriptable is not the same as the PARAM Mayscript. Mayscript provides support for communication from Java applets to JavaScript only, while scriptable allows communication from JavaScript to Java applets in Internet Explorer only.

The text "No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!" in the APPLET tag is mapped inside the <OBJECT> and </OBJECT>tags. Originally, this text is displayed only if the browser does not have Java support. By mapping it inside the OBJECT tag, this text will displayed if the browser does not support the OBJECT tag.

The APPLET-OBJECT tag attributes mapping is as follows:

Attributes 

APPLET tag support 

OBJECT tag support 

Attribute map in OBJECT tag 

ALIGN 

Attribute ALIGN 

ALT 

 

 

ARCHIVE 

 

Param archive 

CODE 

Param code 

CODEBASE 

Param codebase 

HEIGHT 

Attribute HEIGHT 

HSPACE 

Attribute HSPACE 

NAME 

Attribute NAME, Param NAME 

OBJECT 

 

Param object 

TITLE 

Attribute TITLE 

VSPACE 

Attribute VSPACE 

WIDTH 

Attribute WIDTH 

MAYSCRIPT 

Param MAYSCRIPT 

Some attributes are special to the OBJECT tag. These attributes are:

Attribute/Param 

Meaning in OBJECT tag 

Attribute classid 

It should always have the same value for dynamic version support, i.e. clsid:8AD9C840-044E-11D1-B3E9-00805F499D93. For static version support it will have a unique value for the version, e.g., clsid:CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA.  

Note: The examples in this section use the dynamic version.

Attribute CODEBASE 

It should be a full URL pointing to a CAB file somewhere on the network. It should, be default, point to the binary on the Java Software web site. 

Param type 

If it is a Java applet, the value should be “application/x-java-applet;jpi-version=1.4” or “application/x-java-applet”. If it is a JavaBeans component, the value should be “application/x-java-bean;jpi-version=1.4” or “application/x-java-bean”. 

Param codebase 

Specifies the base URL of the applet. This attribute is optional. 

Param code 

Specifies the name of the Java applet or JavaBeans component. It cannot be used the param object inside the same OBJECT tag.

Para scriptable 

Specifies whether the applet is scriptable from the HTML page using JavaScript or VBScript. The value can be either true or false. This attribute is new in Java Plug-in 1.4.

Param object 

Specifies the name of the serialized Java applet or JavaBeans component. It cannot be used with param code inside the same OBJECT tag. This attribute is optional.

Param archive 

Specifies the name of the Java archive. This attribute is optional. 

Param mayscript 

Specifies whether the applet is allowed to access netscape.javascript.JSObject. The value can be either true or false. This attribute is optional.

Note that if the original APPLET tag has PARAM type, codebase, code, object or archive, mapping it to the OBJECT tag will cause a problem because duplicate param names will occur. To avoid this, Java Plug-in also supports another set of param names, as follows:

Original Param Names 

New Param Names 

code 

java_code 

codebase 

java_codebase 

archive 

java_archive 

object 

java_object 

type 

java_type 

You should use these new param names only when necessary. If both the new and original param names exist in the same OBJECT tag, the value associated with the new param name is always used by Java Plug-in to load the applet or JavaBean.