Appendix D. Web-Application Structure and Deployment Descriptor Reference
A complete web application may consist of several different resources: JSP pages, servlets, applets, static HTML pages, custom tag libraries, and other Java class files. Version 2.2 of the servlet specification defines a portable way to package all these resources together with a deployment descriptor that contains configuration information, such as how all the resources fit together, security requirements, etc. This appendix describes the standard file structure for a web application, and how to use the deployment descriptor to configure the application.
Web Application File Structure
The portable distribution and deployment format for a web application defined by the servlet specification is the Web Archive (WAR). All Servlet 2.2-compliant servers provide tools for installing a WAR file and associate the application with a servlet context.
A WAR file has a .war file extension and can be
created with the Java jar command or a ZIP
utility program, such as WinZip, as described at
the end of this appendix. The internal structure of the WAR file is
defined by the servlet specification:
/index.html /company/index.html /company/contact.html /company/phonelist.jsp /products/searchform.html /products/list.jsp /images/banner.gif /WEB-INF/web.xml /WEB-INF/lib/bean.jar /WEB-INF/lib/actions.jar /WEB-INF/classes/com/mycorp/servlets/PurchaseServlet.class /WEB-INF/classes/com/mycorp/util/MyUtils.class /WEB-INF/tlds/actions.tld ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access