SRV.9.4 Directory Structure


A web application exists as a structured hierarchy of directories. The root of this hierarchy serves as a document root for serving files that are part of this context. For example, for a web application located at /catalog in a web server, the index.html file located at the base of the web application hierarchy can be served to satisfy a request to /catalog/index.html .

A special directory exists within the application hierarchy named " WEB-INF ." This directory contains all things related to the application that aren't in the document root of the application. It is important to note that the WEB-INF node is not part of the public document tree of the application. No file contained in the WEB- INF directory may be served directly to a client.

The contents of the WEB-INF directory are:

  • /WEB-INF/web.xml deployment descriptor.

  • /WEB-INF/classes/* directory for servlet and utility classes. The classes in this directory are used by the application class loader to load classes from.

  • /WEB-INF/lib/* .jar area for Java ARchive files which contain servlets, beans, and other utility classes useful to the web application. All such archive files are used by the web application class loader to load classes from.

SRV.9.4.1 Sample Web Application Directory Structure

Illustrated here is a listing of all the files in a sample web application:

 /index.html  /howto.jsp  /feedback.jsp  /images/banner.gif  /images/jumping.gif  /WEB-INF/web.xml  /WEB-INF/lib/jspbean.jar  /WEB-INF/classes/com/mycorp/servlets/MyServlet.class  /WEB-INF/classes/com/mycorp/util/MyUtils.class 


Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net