BEA Logo BEA WebLogic Server Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

Creating a .zip file for an applet

This utility takes the contents of an HTTP server log file in (common log format), finds the Java classes loaded by the server in it, and creates an uncompressed .zip file that contains those Java classes. With the ARCHIVE attribute added to an APPLET HTML tag, the applet when loaded will look first to find the classes it needs in the .zip file reference by the ARCHIVE attribute; if it does not find all of the classes required by the applet in the .zip file, it will load the classes from the HTTP server. Using a compressed .zip archive reduces the time required to load the applet and increases network efficiency.

To use this utility, you must have access to the log files created by the HTTP server. The logToZip utility only works with JDK 1.1.x.

To create a .zip file from the server log:

  1. Before you use this utility, clear the log file. This creates a clean base so that the log contains only those files needed by the applet. You can test the success of clearing the log by scanning it for ".class".

  2. Run the applet for which the .zip file will be used. Use appletviewer to run the applet, which does not cache classes; you want to make sure that all of the classes required by the applet are loaded. Note that you must thoroughly exercise all of the applet's functionality to force all of the required classes to load.

  3. On the HTTP host, change directories to the directory corresponding to the codebase (i.e. where the classes are on the host). The utility must be run from this directory. The resulting .zip file is created in the directory in which you run the program.

  4. Run the utility. It takes the three arguments that are detailed below.

Syntax

From the document root directory of your HTTP server:
  $ java utils.logToZip logfile codebase zipfile

Arguments

logfile
Fully-qualified pathname of the log file.
codebase
The directory part of the applet's CODEBASE URL, or " " if there is no CODEBASE. If you need more help on CODEBASE, check the Administrators Guide document, Using WebLogic products for applet programming.
zipfile
Name of the .zip file to create. The resulting .zip file will be created in the directory in which you run the program. The path of the filename supplied can be relative or absolute. In the examples, a relative pathname is given, so the .zip file is created in the current directory.

Examples

This example shows the creation of a zipfile for an applet that exists in the document root itself (i.e., no CODEBASE).

  $ cd /HTTP/Serv/docs
  HTTP/Serv/docs$ java utils.logToZip /HTTP/Serv/logs/access "" app2.zip

This example shows the creation of a zipfile for an applet that exists in a subdirectory of the CODEBASE, in applets/classes.

  C:\>cd \HTTP\docs
  C:\HTTP\docs>java utils.logToZip \HTTP\logs\access applets\classes app3.zip

This slightly more complicated example shows the creation of a .zip file for an applet that exists in a directory outside of the document root, and that is aliased to a directory called /classes by the webserver.

  $ cd /usr/local/weblogic/classes
  $ java utils.logToZip /usr/local/httpd/logs/access.log classes app4.zip

 

Copyright © 2000 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
Last updated 01/13/1999