[Home]   [Contents]   [Index]   [Javadoc] JCLASS
  [Frames]    [No Frames]
[Previous]   [Next]

B:
Distributing Applets and Applications on a Web Server

Once you have finished programming your Java applet or application, you will undoubtedly want to distribute it to your users. A common method of applet and application distribution is with your Web server. Here is a brief overview of how to deploy applets and applications, as well as reduce the size and customize the contents of the deployment archive1.


Publishing an Applet on a Web Server

You can distribute your applet by putting the Web pages that contain it onto your Web server. Distributing your applet this way involves:

Install the JClass Archives on the Server

First, you need to make sure that your CLASSPATH is not set. Although you will need to set it later when adding applets to the server, keep it undefined for now.

Create a JClass directory on your Web server (e.g. \JClassLib, just below the root document directory). This directory holds all of the archives that came with your JClass products.

 

Example: suggested JClass archives folder name and location

Copy the JClass archive files to the newly created JClassLib directory. The number and version of archives copied over, depend on which JClass products you own. These JAR files are found in the lib directory of your JClass installation. Please refer to the Getting Started with JClass booklet for more information about these files.

Preparing the directory for the applet

Create a directory for the applet classes and their HTML pages. It is important to keep the directory structure identical to the one found in the original location of the classes.

 

Example: proper applet class directory structure (using JClass Elements)

Set a CLASSPATH on Your Web Server

If the applet reads local files from the Web server, the CLASSPATH needs to include the directory in which these files are located. As an example, if your applet uses images, the CLASSPATH needs to point to that images directory.

Install Your Applet Classes and HTML files on Your Web Server

Now that the directories have been created with the correct structure, you can copy over all of the required class and HTML files. The directories in which the class files are copied must be the same as the ones from where they are being copied. The HTML files can be placed together in a different location from the associated HTML files (as a suggestion, either the JClassLib or JClass will work fine), since they can point to class files in different locations.

Since your HTML files contain a JClass applet, and they might be located in a different directory from the associated class files, there are certain attributes that must be used to ensure that the file points to the proper JClass archive, class and location.

Any printed or online HTML reference can provide more in-depth information about these attributes. Please refer to it if you need to.

For troubleshooting information about the above procedures, please refer to the JClass Knowledge Base on KL Group's Web site support area, and perform an online search for Publishing JClass Products on a Web Server.


Using JarMaster to Customize the Deployment Archive

The size of the archive and its related download time are important factors to consider when deploying your applet or application.

When you create an applet or an application using third-party classes such as JClass components, your deployment archive will contain many unused class files unless you customize your JAR. Optimally, the deployment JAR should contain only your classes and the third-party classes you actually use. For example, the jcfield[xxx].jar, which you used to develop your applet or application, contains classes and packages that are only useful during the development process and that are not referenced by your application. These classes include the Property Editors and BeanInfo classes. JClass JarMaster helps you create a deployment JAR that contains only the class files required to run your application.

JClass JarMaster is a robust utility that allows you to customize and reduce the size of the deployment archive quickly and easily. Using JClass JarMaster you can select the classes you know must belong in your JAR, and JarMaster will automatically search for all of the direct and indirect dependencies (supporting classes).

When you optimize the size of the deployment JAR with JClass JarMaster, you save yourself the time and trouble of building a JAR manually and determining the necessity of each class or package. Your deployment JAR will take less time to load and will use less space on your server as a direct result of excluding all of the classes that are never used by your applet or application.

For more information about using JarMaster to create and edit JARs, please consult its online documentation.

JClass JarMaster is installed automatically as part of the install process for JClass Enterprise Suite. It is also available as a separate product. For more details please refer to KL Group's Web site.

 


1. Although the term "archive" has a somewhat ambiguous and flexible definition, for the purpose of this section, it refers to the JClass product JAR files.


[Home]   [Contents]   [Index]   [Javadoc] Comments on the documentation?
Please send them to jclass_docs@klgroup.com
[Previous]   [Next]
[Frames]    [No Frames]

Copyright © 1999-2000 KL Group Inc.