Assemble Web Modules

Before you begin

If you want to use existing Java 2 Enterprise Edition (J2EE) 1.2 Web modules in your J2EE 1.3 application, migrate them to J2EE 1.3 first.

Assemble a Web module to contain servlets, JSP files, and related code artifacts. (Group enterprise beans, client code, and resource adapter code in separate modules).

A Web module can be installed as a stand-alone application or can be combined with other modules into an enterprise application.

The Application Assembly Tool (AAT) provides flexibility in assembling Web modules. Options described below include:

  • Importing an existing Web module (WAR file)
  • Create a new Web module
  • Copying code artifacts (such as servlets) from one Web module into a new Web module

Although you can input various properties for Web archives, available properties are specific to the Servlet, JSP, and J2EE specification level.

Steps for this task

  1. Start the AAT.
  2. From the New tab, select Web Module. Click OK.
    The navigation tree now displays various sets of properties for configuring the new Web module.
  3. (Optional)   Use the property dialog shown in the AAT workspace to change the default file name and location.

    1. It is recommended that you change the display name so that it differs from the file name.
    2. If you like, change the temporary location of the Web module from the default location, install_root/bin.

  4. Add at least one Web component (servlet or JSP file) to the module.
    You must add at least one Web component, using one of the following methods.

    • Import an existing WAR file containing Web components.

      1. In the navigation tree, right-click the Web Components folder.
      2. Select Import from its right-click menu.
      3. Use the file browser to locate and select the archive file for the module.
      4. Click Open. The Web applications in the selected archive are displayed.
      5. Select a Web application. Its Web components are displayed in the workspace.
      6. Select the servlets or JSP files to be added and click Add. The components are displayed in the Selected Components window.
      7. Click OK. The properties associated with the archive are also imported. The property dialog boxes in the workspace are populated automatically with values.
      8. Double-click the Web Components icon to verify that the servlets or JSP files are included in the module.
      9. Double-click the Web Components icon to verify that the servlets or JSP files are included in the module.
      10. Save the Web module.

    • Copy and paste archive files from an existing module into the new Web component.
    • Create a new Web component.

      1. In the navigation tree, right-click the Web Components folder.
      2. Select New from its right-click menu.
      3. When the new module is displayed, enter a component name and choose a component type.
      4. Use the file browser to locate and select the archive file for the module.
      5. Click the plus sign (+) to verify its contents and enter assembly properties.
      6. In the New Web Component property dialog box, click OK.
      7. Verify that the Web component has been added to the module by double-clicking the Web components icon in the navigation tree.
      8. Click the component to view its corresponding property dialog box in the bottom portion of the pane.

  5. Enter assembly properties for each Web component.

    1. Click the plus sign (+) next to the each component to reveal its property groups.
    2. Right-click each property group icon and click New to display properties in the workspace.

  6. Specify additional properties for the Web module.

    Right-click each property group's icon. Choose New to add new values, or edit existing values in the property pane. (Click Help for descriptions of the settings).

    Note that if you add a security constraint, add at least one Web resource collection.

  7. Add any other files needed by the application.

    • In the navigation tree, click the plus sign (+) next to the Files icon. Right-click Add Class Files, Add JAR Files, or Add Resource Files. Select Add Files.
    • Add files, using the Add Files dialog.

  8. Save the application.

What to do next

Assemble other new modules of your choice, if needed:

You can also migrate existing modules.

Another option is to proceed directly to assembling a new application module. While assembling an application module, you can create any new modules that you need.