The JavaTM Web Services Tutorial
Home
TOC
PREV TOP NEXT

Web Application Archives

If you want to distribute a Web application and run it on another server you package it in a Web application archive (WAR), which is a JAR similar to the package used for Java class libraries, and installed (or deployed) into a Web container. In addition to Web components, a Web application archive usually contains other files including:

Web components and static Web content files are called Web resources.

A WAR has a specific directory structure. The top-level directory of a WAR is the document root of the application. The document root is where JSP pages, client-side classes and archives, and static Web resources are stored.

The document root contains a subdirectory called WEB-INF, which contains the following files and directories:

You can also create application-specific subdirectories (that is, package directories) in either the document root or the WEB-INF/classes directory.

The ant build files distributed with the tutorial examples construct this directory structure in the build subdirectory.

Creating a WAR File

You can manually create a WAR in two ways:

Home
TOC
PREV TOP NEXT