The EASDefault Web application  Localizing Web applications

Chapter 21: Creating Web Applications

Using Java extensions

In Java, an extension is a formally described set of related classes that extends the functionality offered by the base Java platform or by a J2EE application server. Extensions are packaged as Java JAR files, and include additional information in the JAR file’s manifest.mf file to describe the extensions characteristics, such as:

For more information on Java extensions, see the the Java documentation.

In accord with the Servlet 2.3 specification, EAServer allows you to install extensions and define the extensions required by a Web application. If you import a Web application (in WAR format) that requires extensions that are not installed, EAServer Manager warns you of the unfulfilled dependencies.


Installing extensions in EAServer

In your EAServer installation, installed Java extensions are stored in the extensions subdirectory. All Web applications in one EAServer installation have access to the same set of installed Java extensions. In EAServer Manager, you can manage Java extensions from the top-level Web Applications or from the Installed Web Applications folders for any application or server.

StepsViewing installed extensions in EAServer Manager

  1. Highlight the top-level Web Applications folder, or the Installed Web Applications folder in your application or server.

  2. Choose File | View Installed Extensions

  3. EAServer Manager displays the list of installed extensions. “EAServer Java extension properties” describes the fields.

StepsInstalling a new extension using EAServer Manager

  1. Make sure the extension JAR file is accessible on the machine where you are running EAServer Manager

  2. Follow the steps in “Viewing installed extensions in EAServer Manager” to display the Installed Extensions dialog box.

  3. Click Add, then specify the full path to the extension JAR file.

  4. EAServer Manager verifies that the extension’s manifest.mf file is formatted correctly, and if so, copies the extension JAR file to the EAServer extensions subdirectory.


Defining required extensions for Web applications

You can define the extensions required by your Web applications in EAServer Manager or in the manifest.mf file bundled within a Web application archive (WAR) file. Doing so increases the portability of the Web application among J2EE servers from different vendors. When a server imports a WAR file that specifies required extensions, it checks that the required extensions are available.


Defining required extensions in EAServer Manager

Follow this procedure if you are defining or modifying a Web application in EAServer Manager. When you export the Web application in WAR format, EAServer Manager includes the dependency information.

StepsDefining required extensions in EAServer Manager

  1. Display the Web Application properties dialog box.

  2. Display the Extensions tab.

  3. Click Add to create a new extension in the list, then edit the fields described in Table 21-2.


EAServer Java extension properties

Table 21-2 describes the fields in EAServer Manager’s Installed Extensions dialog box and the corresponding entries in the manifest.mf file within an extension JAR file.

Table 21-2: Java Extension Properties

EAServer Manager field

Manifest entry

Description

Extension Name

Extension-Name

The extension name.

Specification Version

Specification-Version

The version number of the specification that the extension conforms to.

Specification Vendor

Specification-Vendor

The company or organization responsible for the specification that the extension conforms to.

Implementation Version

Implementation-Version

The implementation version number.

Implementation Vendor

Implementation-Vendor

The company or organization responsible for the implementation.

Implementation Vendor ID

Implementation-Vendor-ID

A unique identifier for the company or organization responsible for the implementation. Usually follows the reverse-domain naming convention used in Java packages, for example, “com.sybase.”

Implementation URL

Implementation-URL

A Web URL to obtain information on the implementation.


Defining required extensions in the WAR manifest file

If you are creating Web applications outside of EAServer Manager, you must specify required Java extensions by adding entries to the manifest file within the WAR (path META-INF/MANIFEST.mf). If you are using a Java development tool that supports the Servlet 2.3 specification, your tool most likely provides graphical support for specifying dependencies. See your tool’s documentation for details.


WAR manifest format

The Extension-List manifest entry lists the names of required extensions. This entry has the form:

Extension-List: ext1 ext2 ext3 ...

Where ext1, ext2, ext3, and so forth are the names of the required extensions. For each name, you must specify additional entries from the Manifest entry column of Table 21-2, prefixed with the name and a hyphen. For example, if the name is javahelp, you must specify a javahelp-Extension-Name entry as well as the other manifest entries from Table 21-2. You may specify additional entries not in Table 21-2, but these are ignored by EAServer.


Example

The following example shows a section of a WAR manifest that requires two extensions, javahelp and java3d:

Extension-List: javahelp java3d 
javahelp-Extension-Name: javax.help 
javahelp-Specification-Version: 1.0
javahelp-Implementation-Version: 1.0.3 
javahelp-Implementation-Vendor-Id: com.sun 
java3d-Extension-Name: javax.3d 
java3d-Specification-Version: 1.0 
java3d-Implementation-Version: 1.2.1 
java3d-Implementation-Vendor-Id: com.sun 





Copyright © 2005. Sybase Inc. All rights reserved. Localizing Web applications