Write the HTML page that embeds the applet application client

Standard applets require the HTML <APPLET> tag to identify the applet to the browser. The <APPLET> tag invokes the browser's Java virtual machine; therefore, an applet running on Internet Explorer uses Microsoft's Java virtual machine.

For applets to communicate with enterprise beans in the WAS environment, the <APPLET> tag must be replaced with these two new tags:

  <OBJECT>
  <EMBED>

Additionally, the classid and type attributes cannot be modified, and must be entered as described in the applet client example. Finally, the codebase attribute on the <OBJECT> tag must be excluded.

Note: Do not confuse the codebase attribute on the <OBJECT> tag with the codebase attribute on the <PARAM> tag. Although both are called codebase, they are separate attributes.

The following code snippet illustrates an HTML page that embeds an applet application client. In this example, MyAppletClass.class is the applet code, Applet.jar is the file that contains the applet code, and EJB.jar is the file that contains the deployed enterprise bean code. MYISERIES is the name of the iSeries server where WAS runs, and MYPORT is the port number for the WebSphere naming service.

  <OBJECT classid="clsid:8AE2D840-EC04-11D4-AC77-006094334AA9"
   width="600" height="500">

    <PARAM NAME=CODE VALUE="MyAppletClass.class">
    <PARAM NAME="archive" VALUE="Applet.jar, EJB.jar">
    <PARAM TYPE="application/x-java-applet;version=1.3">
    <PARAM NAME="scriptable" VALUE="false">
    <PARAM NAME="cache-option" VALUE="Plugin">
    <PARAM NAME="cache-archive" VALUE="Applet.jar, EJB.jar">

    <COMMENT>
      <EMBED type="application/x-websphere-client" CODE=MyAppletClass.class
         ARCHIVE="Applet.jar, EJB.jar" WIDTH="600" HEIGHT="500"
         scriptable="false"
         java.naming.provider.url="iiop://MYISERIES:MYPORT" 
         java.naming.factory.initial=
           "com.ibm.websphere.naming.WsnInitialContextFactory">    
      </EMBED> 
      <NOEMBED>
        WebSphere Java application/applet thin client for Windows is required.
      </NOEMBED>
    </COMMENT>
  
  </OBJECT>

Note: The value of the type attribute on the <EMBED> tag can also have a value of "application/x-websphere-client, version=5.0"