Copy the file html/docs/tutorial/java-corba/runjavatut.html to the html/classes/TutorialApps subdirectory in your EAServer installation. This file has the OBJECT and EMBED tags required to launch the applet in the Sun Java Plug-in:
<html><body bgcolor="#FFFFFF"> <head><title>This Applet runs the EAServer tutorial Java component.</head></title> <hr> <center> <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 600 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"> <PARAM NAME = CODE VALUE = "TutorialApps/JAClient.class" > <PARAM NAME = CODEBASE VALUE = "/classes" > <PARAM NAME = ARCHIVE VALUE = "easj2ee.jar,easclient.jar" > <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> <PARAM NAME="scriptable" VALUE="false"> <PARAM NAME="ior" VALUE ="iiop://:9000"> <COMMENT> <EMBED type="application/x-java-applet;version=1.3" CODE = "TutorialApps/JAClient.class" CODEBASE = "/classes" ARCHIVE = "easj2ee.jar,easclient.jar" WIDTH = 600 HEIGHT = 400 ior = "iiop://:9000" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"> <NOEMBED> </COMMENT> <h2>This would be a Cool Applet, but you are not running a Java enabled browser...</h2> </NOEMBED> </EMBED> </OBJECT> </center> <hr> </body></html>
No changes are required to this HTML file if your server is configured to use the default IIOP port number, 9000. If you (or your administrator) changed the IIOP port number after installing EAServer, edit the port number in the HTML file to match. You must edit the port number in both the OBJECT and the EMBED tag. In the OBJECT tag, the port number appears in this line:
<PARAM NAME = "ior" VALUE ="iiop://:9000">
In the EMBED tag, the port number appears in this line:
ior = "iiop://:9000"
You can skip this section if your only goal is to run the tutorial applet. If you are modifying the tutorial code to run your own applets, you need to understand these tags.
The OBJECT tag is required to load the applet in Internet Explorer. The EMBED tag is required to load the applet in Netscape. You can run Sun’s HtmlConverter tool to convert standard APPLET tags to equivalent OBJECT and EMBED tags. HtmlConverter is available at the Java Plug-in Web site.
The OBJECT and EMBED tags contain similar parameters. See the Java Plug-in Web site for full documentation of the tag formats. The parameters of interest for this tutorial are:
CODE
, which
specifies the applet class, TutorialApps/JAClient.class
.
CODEBASE
, which
specifies the download URL for the applet class and all other required
classes. In this case, the classes are downloaded from the classes directory
under the server’s document root.
ARCHIVE
, which
specifies JAR files required to run the applet. In this case, easj2ee.jar and easclient.jar.
These files must exist at the location specified by the CODEBASE
parameter.
The JAR files must be specified in this order, because classes in easclient.jar depend
on classes in easj2ee.jar.
You can also load all class files from the code base, or all classes from a single JAR file. For best performance, applets should be deployed with all required classes in one JAR file. However, optimization is beyond the scope of this tutorial.
ior
, which
is read by the applet source code to establish the IIOP connection
to EAServer. The value is an IIOP URL of the form:
iiop://host:iiop-port
The host name is optional. The value iiop://:9000
specifies
port 9000, on the server from which the applet was downloaded.
WARNING! If you specify a host name other than the Web server host name, users cannot run your applet unless they modify the security constraints in their installation of the Java Plug-in.
Copyright © 2005. Sybase Inc. All rights reserved. |