Java Reference
In-Depth Information
IDEA
provides extensive support to the
J2EE
architecture, including support for
servlets, JavaServer Pages (
JSP
s), and Enterprise JavaBeans (
EJB
s).
IDEA
's support
goes far beyond just recognizing
JSP
syntax and the Servlet
API
; it covers every-
thing from initial creation and editing of source files and content to building,
deploying, and real-time debugging of web applications.
IDEA
has rich support for web applications embedded throughout all its tools
and features.
IDEA
's web development support should appeal to servlet and
JSP
developers of any skill level, whether you're architecting a large-scale
J2EE
appli-
cation or doing basic
JSP
markup.
To illustrate some of the points in this chapter, we'll extend the
ACME
Cur-
rency Converter by adding a simple web application front-end.
11.1 Working with web applications
Web applications are designed to run across a network and in the context of a web
browser, and the
J2EE
platform provides a strong foundation on which to build
these applications. Those based on the
J2EE
platform are typically implemented
using the Java Servlet and JavaServer Pages
API
s. In fact, a web application can be
thought of as a collection of libraries, Java classes,
JSP
files, and other resources
bundled together with a deployment descriptor that describes their use. Such an
application can be deployed to any
J2EE
-compliant server in the form of a web
application archive file (also known as a
WAR
file or a
WAR
). The format of the
WAR
file is part of the Java Servlet Specification; it's a standard
JAR
file with some
additional requirements.
A
WAR
file defines a provider-independent way of combining
HTML
,
JSP
s,
servlets, Java classes, and
JAR
s into a single deployable package. This vendor
neutrality is made possible through a standardized
XML
deployment descriptor
that controls such elements as servlet names and
URL
mappings. Once created,
the
WAR
file is deployed into an application server, which reads the deployment
descriptors and makes the application available.
Exploring the full extent of the servlet and
JSP
technologies is beyond the
scope of this book, and we're going to assume that you have some degree of
familiarity with those technologies. The following material will focus on
IDEA
's
support for the working with
J2EE
web applications.
11.1.1
Understanding web modules
Simply put, a
web module
is a specific type of
IDEA
module that is designed to con-
tain a web application. By defining a web application inside a web module (as