Ultra Light Client Guide and Reference


Using the sample ULC HTTP server

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:

  1. Make sure that installation of the ULC HTTP server has been completed. See Setting up the sample ULC HTTP server.
  2. Start a Web browser. The HTTP server currently supports Navigator 3.0 and above, and Internet Explorer 3.0 and above.
  3. Start the HTTP server. By default, the HTTP server listens on port 80 for HTTP requests. The server is generally run on the application server machine. You can start it from a DOS prompt or by double-clicking ULCSamples\HttpServer\bin\httpserver.bat from a file browser.
  4. Retrieve the ULC HTTP server home page. You do this by following a URL to the HTTP server.
    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.
  5. Connect to an application by doing one of the following:
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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]