Up: Distributing the Math Viewer Applet

Delivering Math Viewer Program Files

When a reader tries to look at an HTML page containing WebEQ Math Viewer applet tags, the reader's Web browser must load and run the Math Viewer applet. If the browser has a copy of the WebEQ Math Viewer archive installed, it will use that local copy. However, if no archive file is found, the browser will automatically contact the server again, and attempt to download the Math Viewer program files.

In order to know where to find the applet program files, the browser looks at the value of the codebase parameter in the applet tags. If a reader is opening an an HTML page on the local disk, the value of the codebase can just be the pathname of the WebEQ installation on the local disk. However, if the reader is opening a page from a Web server over the Internet, the codebase must be a URL to a WebEQ installation, typically also on that server.

As with URLs in links, the codebase can either be an absolute URL of the form

http://www.myserver.org/WebEQ/classes/
or a relative URL such as
../myfiles/WebEQ/classes/

If you are a webmaster, installing WebEQ for a number of users, it will generally be simpler to put one copy in a central location. On the other hand, if you simply posting pages on a server you don't control, it will be easier to put WebEQ somewhere nearby in you file area.

In order to simplify the preparation of web pages with WebEQ applets that will be distributed on a server, most authors will want to put a copy of the WebEQ classes directory in the same location relative to the HTML files on the local file system that it will ultimately occupy on the web server.

When placing the WebEQ classes directory in the proper relative location, it is very important to copy the classes directory, rather than move it. If you move it, the WebEQ tools will no longer run on the local system.

The default location of the classes directory when WebEQ is installed on a Windows 95/NT system is

C:\Program Files\GeomTech\WebEQ\2.5\classes

If you used an alternate installation directory or are using WebEQ on a Macintosh or a UNIX system, replace

C:\Program Files\GeomTech\WebEQ\

with the directory that you used for your installation.

Example: Individuals

Individuals typically make a copy of the WebEQ classes directory tree in a location on your system near the directory containing their HTML files. You then specify that relative pathname as the CODEBASE in your WebEQ applet calls. The simplest approach is to to put the classes directory tree is in the same directory with your HTML files, in which case the codebase would be just "classes". Alternatively, you can copy the contents of the classes directory to the same directory with your HTML files, and in this case, no codebase would need to be specified at all, since the current directory is the default.

Note that if you move the HTML files to another directory, you will need to move the classes directory along with them. Alternatively, you will need to change the value of CODEBASE in all of the applets in the files that move to point to the old location.

As an example, assume that you have made a copy of the directory

C:\Program Files\GeomTech\WebEQ\2.4\classes

in a directory called htmlfiles on your server. The directory htmlfiles contains a web page file1.html and a subdirectory containing another web page, file2.html.

        htmlfiles
            |
  -------------------------------
  |             |               |
classes     file1.html     subdirectory
                                |
                            file2.html
An applet call in file1.html would look like this:
<APPLET CODEBASE="classes" CODE="webeq.Main"
 WIDTH=400 HEIGHT=200>
<PARAM NAME=eq
       VALUE="x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a}">
</APPLET>
An applet call in file2.html would use CODEBASE="../classes"

Example: Webmasters

Webmasters typically make a single copy of the WebEQ classes directory in a location accessible to the server. Then when individual authors prepare WebEQ documents for publication on the server, they should then specify the pathname of the server classes directory as the codebase in their WebEQ applet calls. The applet codebase parameter can either be given as a relative path, as an absolute path relative to the Web server's root directory, or as a URL.

Suppose a server with the address

         http://www.myserver.edu
has the directory C:\www on the local file system specified as the Web root. That is, a file C:\www\foo.html corresponds to the URL
         http://www.myserver.edu/foo.html
Then one might copy the classes directory to C:\www\classes, and then all HTML files containing WebEQ calls could specify that absolute URL for the CODEBASE:
        <applet code="webeq.Main"
                codebase="http://www.myserver.edu/classes" ...>
        ...
        </applet>

The main advantage is that such an applet call would work for any HTML page on the site, regardless of it's location relative to the "classes" directory on the file system, and HTML files can be moved, even to another server, without changing the codebase.

The main disadvantage is that this would not work if one were to open an HTML page as a file with a Web browser, since the browser would not know how to translate the absolute URL. This difficulty can be avoided by using a relative directory name for the codebase parameter.

In the example above, the equivalent relative URL is just

        <applet code="webeq.Main"
                codebase="classes" ...>
        ...
        </applet>
since foo.html and the classes directory are both located in C:\www.


[HOME] WebEQ 2.5 Server Software Documentation

Created: Aug 08 1997 --- Last modified: Sun Jul 23 20:07:01 2000
Copyright © 1997-2000 Design Science, Inc. All rights reserved.