Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Quick Start Guide

Packaging the Application using deploytool

In this section, you practice packaging the Hello World application using deploytool

ProcedureTo Package the Application using deploytool

Steps
  1. Select File ⇒ New ⇒ Web Component.

    The wizard’s Introduction appears.

  2. Click Next to display the Wizard’s main screen.

    You will create a new stand-alone WAR module, so accept the default selection for the WAR Location panel.

    With the hello.war file open, the default WAR File location is shown as install_dir/samples/quickstart/. With no WAR files open, the field is blank. Either way, click the Browse button to specify the name of the WAR file to create. (“WAR File” must specify the full path to a WAR file.)

  3. If you are not already there, navigate to install_dir/samples/quickstart.

  4. Enter the filename as hello2 and click Create Module File to create the WAR file and return to the Wizard.

    The Wizard now shows WAR Name as hello2. WAR Display Name is the title that appears in administration utilities like deploytool and the Admin Console. It defaults to the same name as the WAR file in the Wizard, but it can be different.

  5. In Context Root enter /hello2 to define the URL for the web application as http://server:port/hello2. In most production systems, of course, the Application Server software uses a default port, so the port number is not part of the URL that users type.

  6. Click Edit Contents to add the files that make up the application.

    The Edit Content dialog appears.

    You can press the Control key and click multiple files.

  7. Navigate to install_dir/samples/quickstart.


    Note –

    You can use the drop-down list of shortcuts.


  8. In the lower panel, “Contents of hello2,” click the WEB-INF node to expand it.

  9. In the upper panel, “Available Files,” under src/conf, click the file LocalStrings.properties and drag and drop it on the WEB-INF/classes directory in the lower panel.

    The LocalStrings.properties file is added under the WEB-INF/classes directory.

  10. In the web/ directory, select the images/ directory and the index.jsp and response.jsp files.

  11. Click Add. The dialog shows that the selected files have been added.

    Dialog showing directory tree of Hello2 application's contents.
  12. Click OK to return to the Wizard’s WAR File definition window.

  13. Click Next to complete the process of defining the WAR file.

    The Choose Component Type dialog appears.

  14. Select JSP Page and click Next.

    The Component General Properties screen appears.

  15. From the drop-down list for “JSP Filename,” select index.jsp.

    This selection populates the other fields with default values based on the name.

  16. Click Next and read the notes about the next steps you can take.

  17. Click Finish to end the Wizard and return to the deploytool screen.

Next Steps

You have just packaged a simple application. In The J2EE 1.4 Tutorial, you can learn how to package more complex applications, but the general outline of the process is similar. Now that it is packaged, deploying the application is a simple operation. You will do that next.