MSc-IT Study Material
June 2010 Edition

Computer Science Department, University of Cape Town

The structure of a Web application

Since the Servlet API 2.2 specification, every Servlet aware Web server is required to accept Web applications in a standard format. A Servlet Web application is defined as a collection of directories and files, all of which can possibly be compressed into a single file called a Web application archive (WAR). These WAR files are a useful way to distribute your Web application once you have written it, but we will not be covering them in these notes.

The Servlet specification defines in what directories various files making up the application should be placed. If our Web application is stored in a directory called APPLICATION, then the various files should be laid out as follows:

All of the following examples use the layout described above.