Web components and static Web content files are called Web resources.
A WAR has a specific directory structure. The top-level directory of a WAR is the document root of the application. The document root is where JSP pages, client-side classes and archives, and static Web resources are stored
The document root contains a subdirectory called WEB-INF
, which contains the following files and directories:
web.xml
: The Web application deployment descriptorclasses
: A directory that contains server-side classes: servlets, utility classes, and JavaBeans componentslib
: A directory that contains JAR archives of libraries (tag libraries and any utility libraries called by server-side classes).You can also create application-specific subdirectories (that is, package directories) in either the document root or the WEB-INF/classes
directory.
Note: When you add classes and archives to a WAR, deploytool
automatically packages them in the WEB-INF
subdirectory. This is correct for Web components and server-side utility classes, but incorrect for client-side classes such as applets and any archives accessed by applets. To put client-side classes and archives in the correct location, you must drag them to the document root after you have added them to the archive.