Java Reference
In-Depth Information
Web Archive Files
Web Archive (WAR) files contain the following:
•JSP pages and related Java classes
• HTML static pages, image files, and so on
• The
classes
subdirectory in
WEB-INF
that contains any Java class files and needed
resources for Servlets and JPSs
• The Web deployment descriptor, usually named
Web.xml
in the
WEB-INF
directory
• The
MANIFEST.MF
standard manifest file in the
META-INF
directory
Enterprise Archive Files
Enterprise Archive (EAR) files contain the following:
•EJB modules
•Web modules
• The
application.xml
file in the
META-INF
directory, containing runtime information for
the application
• The
MANIFEST.MF
standard manifest file in the
META-INF
directory
A simple example of Java enterprise software deployment is given in the following section.
A J2EE Example
Here, we will deploy the servlet mentioned in the MIDlet section previously introduced. It is
shown in Listing 5.11.
L
ISTING
5.11
The
LicenseServlet
Servlet
package com.marinilli.b2.c5;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
/**
* Chapter 5 - A Simple Servlet License Manager
*
* @author Mauro Marinilli
* @version 1.0
*/
5