Java Reference
In-Depth Information
Java-Bean: true
Name: LabelText.class
Not much exciting has happened besides the addition of a few lines. But the class is now
ready for use as a JavaBean. For a GUI builder, either copy it into the
beans
directory or use
the bean installation wizard, as appropriate.
Packaging a Servlet into a WAR File
Problem
You have a servlet and other web resources and want to package them into a single file for
deploying to the server.
Solution
Use
jar
to make a web archive (WAR) file. Or, as mentioned earlier, use Maven with
pack-
aging=
war
.
Discussion
Servlets are server-side components for use in web servers. They can be packaged for easy
installation into a web server. A
web application
in the Servlet API specification is a collec-
tion of HTML and/or JSP pages, servlets, and other resources. A typical directory structure
might include the following:
index.html, foo.jsp
Web pages
WEB-INF
Server directory
WEB-INF/web.xml
Descriptor