Previous ION Java User's Guide: Overview of ION Java Next

Where to Place HTML and Class Files

When you begin developing your own applications, you'll need to decide where you will put the HTML and Java class files that make up your applications. This section discusses some strategies for locating your files.

Web-based ION Java applications consist of at least two types of files:

HTML files must reside on your Web server, which may or may not be the same machine on which the ION Server is located. Your class files, however, must reside on the same host machine as the ION Server. This is due to Java applet security mechanisms.

Testing ION Applications Locally

When learning how to write ION applications, and running the example applications included with ION Java, you may find it easier to load the applications directly from the ION Server machine rather than placing the files on your Web server and loading them over a network. This allows you to run the example applications right from one of the examples directories of your ION Java installation, and makes the process of developing and testing your applications easier. This also takes the Web server out of the loop, thereby eliminating the Web server as a potential source of application errors. If you run the example applet applications directly from the ITT_DIR\idl64\products\ion64\ion_java\examples directory (Windows) or ITT_DIR/ion64/ion_java/examples directory (UNIX), you do not need to change the CODEBASE attribute for any of the <APPLET> tags.


Note
Certain browsers may generate a Java security exception when attempting to start an applet contained in an HTML file opened by selecting "Open" from the File menu. This exception prevents the applet from running. To work around this exception, browse to the basic.html file using a URL that looks like http:// rather than file://.

Publishing ION Applications on Your Web Server

Once you have developed your ION applications, you will need to place the HTML files on your Web server. The recommended method is to create a subdirectory for ION applications under the default documents directory on your Web server. For example, suppose you are using the Apache Web server. You could create a subdirectory under the htdocs directory called \IONJava\myhtml in which you place all your HTML files. The URL of such a page might be:

http://myhost.mydomain.com/myhtml/index.html  

You can then develop and test your applications locally. When everything is working correctly, you can publish your application by copying the myhtml directory containing your HTML files, and your .class files to your web server.

If you do not place HTML files in a directory that is in or under the default documents directory on your Web server (such as the htdocs directory on the Apache Web server), you need to configure your Web server to allow access to files in your directory. For example, if you place your HTML pages in a directory called C:\Program Files\ITT\idl64\products\ion_java\html, you need to configure your Web server to allow access to this directory. Using Apache, modify DocumentRoot in the httpd.conf file to include additional directories or modify Alias in the httpd.conf file to add aliases to directories where you can place HTML files.

Where to Locate the ION Class Files

ION applets and applications must have access to the ION class files in order to run. There are two ways to provide access to the ION class files:

Placing class files and HTML files in the same directory saves you from having to use the CODEBASE attribute, but we recommend that you point to the .jar or .zip files, described in the following section, and create separate directories for class and HTML files.

For example, suppose you are using the Apache Web server. You could create a subdirectory under the htdocs directory called \IONJava\classes in which you place all the required class files. Assuming that your HTML files are in the \IONJava\html directory, you would specify the CODEBASE attribute as follows:

CODEBASE="../classes"  

See CODEBASE for further details.

What Are the Required Class Files?

During installation, ION class files are installed in the following location on the ION Server machine:

Windows:

ITT_DIR\idl64\products\ion64\ion_java\classes\  

UNIX:

ITT_DIR/ion64/ion_java/classes/  

where ITT_DIR is the location of the ITT directory on your system.

The ION installation program also copies these files to your Web server's java files directory if you completed the "ION Java Web Server Configuration" dialog. For example, using the Apache Web server on Windows, the Web_Server directory might be similar to C:\Program Files\Apache Group\Apache\htdocs.

ION's Java class files are provided in three formats:

  1. The raw Java class files are located in the com/itt/ion subdirectory of the classes directory.
  2.  

  3. A ZIP file named ion_64.zip. This contains compressed versions of all the classes. This file is installed in the classes directory and is also copied to your Web_Server/IONJava/classes directory.
  4.  

  5. A Java archive (JAR) file named ion_64.jar. This file contains uncompressed version of the ION class files. This file is installed in the classes directory an is also copied to your Web_Server/IONJava/classes directory.

If you decide to create your own directory for the ION Java classes, you will need to copy the classes directory files specified in the section Manually Configuring Your Web Server to the new directory. Copying the com directory and subdirectories to your new directory is optional.

For more on the ION Java class files, see Supporting Java Archive Files.

  IDL Online Help (March 06, 2007)