10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FIGURE 3–5 Web Module Structure<br />

web.xml<br />

sun-web.xml<br />

*.tld<br />

WEB-INF<br />

lib<br />

Library<br />

archive files<br />

PackagingWeb Modules<br />

A web module must be packaged into a WAR in certain deployment scenarios and whenever<br />

you want to distribute the web module. You package a web module into a WAR by executing<br />

the jar command in a directory laid out in the format of a web module, by using the Ant utility,<br />

or by using the IDE tool of your choice. This tutorial shows you how to use NetBeans IDE or<br />

Ant to build, package, and deploy the sample applications.<br />

To build the hello1 application with NetBeans IDE, follow these instructions:<br />

1. Select File→Open Project.<br />

2. In the Open Project dialog, navigate to:<br />

tut-install/javaeetutorial5/examples/web/<br />

3. Select the hello1 folder.<br />

4. Select the Open as Main Project check box.<br />

5. Click Open Project.<br />

Assembly<br />

Root<br />

classes<br />

All server-side<br />

.class files for<br />

this web module<br />

JSP pages,<br />

static HTML pages,<br />

applet classes, etc.<br />

tags<br />

All .tag files<br />

for this<br />

web module<br />

Web Modules<br />

Chapter 3 • Getting Started withWeb Applications 83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!