The sample ULC HTTP server can generate custom Web pages that enable a Web browser to start the UI Engine as an applet and then connect to a running ULC application. The HTTP server comes with all of the directory structure, Java files, and HTML pages required to run a set of sample ULC applications as applets. The setup also enables you to easily modify the sample Web pages to add your own applications and extensions.
This component is part of the ULC samples package shipped with VisualAge. To use it, follow these steps:
Note: | The sample ULC HTTP server is shipped for both VisualAge Smalltalk and VisualAge for Java. You must select the ULC Smalltalk link from the ULC HTTP home page. |
Select the Connect button on the Application Controller.
Click the appropriate application icon on the custom Web page.
Note: | If the samples do not run as an applet, open the Java Console window of your browser and check for security exceptions. This is commonly caused when the DNS name of your machine does not match the name used to make the connection to the HTTP server. |
Using the ULC HTTP server, you can create pages to connect to application servers running on the same machine as the Web server without having to explicitly code the host name into each web page. The HTTP server treats HTML pages with the extension .shtml in a special way: if the HTTP server is asked to serve one of these pages up, it searches within the page for all occurrences of the $WEBHOST token and replaces it with the host name of the machine on which it is running.
For example, suppose the Web page to connect as an applet to a running ULC Application Controller contains the following:
<APPLET archive="ulcui.jar" code="UIApplet.UIApplet.class" width="300" height="70"> <PARAM name="url" value="ulc://$WEBHOST:2222/AppController"> <PARAM name="title" value="ULC AppController Applet"> </APPLET>
When the file is served up by the ULC HTTP server, the Web browser starts the UI Engine as an applet and attempts to connect to the Application Controller running on the same machine as the Web server at port 2222.
For examples of the specially formatted web pages, unpack <ulcrt>/ULCSamples/HttpServer/lib/httpserver.jar and look at <ulcrt>/ULCSamples/HttpServer/lib/com/ibm/ulc/httpServer/resources/*.uhtml.