background image

JavaServer Faces Application

<< Registering a Custom Component | Application with a Deployment Descriptor >>
<< Registering a Custom Component | Application with a Deployment Descriptor >>

JavaServer Faces Application

Basic Requirements of a JavaServer Faces Application
In addition to configuring your application, you must satisfy other requirements of JavaServer
Faces applications, including properly packaging all the necessary files and providing a
deployment descriptor. This section describes how to perform these administrative tasks.
JavaServer Faces applications must be compliant with the Servlet specification, version 2.3 (or
later) and the JavaServer Pages specification, version 1.2 (or later). All applications compliant
with these specifications are packaged in a WAR file, which must conform to specific
requirements in order to execute across different containers. At a minimum, a WAR file for a
JavaServer Faces application must contain the following:
A web application deployment descriptor, called web.xml, to configure resources required
by a web application
A specific set of JAR files containing essential classes
A set of application classes, JavaServer Faces pages, and other required resources, such as
image files
An application configuration resource file, which configures application resources
The WAR file typically has this directory structure:
index.html
JSP pages
WEB-INF/
web.xml
faces-config.xml
tag library descriptors (optional)
classes/
class files
Properties files
lib/
JAR files
The web.xml file (or deployment descriptor), the set of JAR files, and the set of application files
must be contained in the WEB-INF directory of the WAR file.
Basic Requirements of a JavaServer Faces Application
The Java EE 5 Tutorial · September 2007
458