background image

Packaging Web Modules

<< Document Root of the Application. | Deploying a WAR File >>
<< Document Root of the Application. | Deploying a WAR File >>

Packaging Web Modules

Packaging Web Modules
A web module must be packaged into a WAR in certain deployment scenarios and whenever
you want to distribute the web module. You package a web module into a WAR by executing
the jar command in a directory laid out in the format of a web module, by using the Ant utility,
or by using the IDE tool of your choice. This tutorial shows you how to use NetBeans IDE or
Ant to build, package, and deploy the sample applications.
To build the hello1 application with NetBeans IDE, follow these instructions:
1. Select File
Open Project.
2. In the Open Project dialog, navigate to:
tut-install/javaeetutorial5/examples/web/
3. Select the hello1 folder.
4. Select the Open as Main Project check box.
web.xml
sun-web.xml
*.tld
JSP pages,
static HTML pages,
applet classes, etc.
Library
archive files
lib
Assembly
Root
WEB-INF
All server-side
.class files for
this web module
classes
All .tag files
for this
web module
tags
FIGURE 3­5
Web Module Structure
Web Modules
Chapter 3 · Getting Started with Web Applications
83