Part 2: Creating an initial web.xml file for the new application.
The web.xml file is the Web Application Deployment Descriptor. This file defines all
information that the server needs to know to run the Web application. The definition of the
Descriptor is part of the Servlet API Specification, V2.2. The Apache Software Foundation
provides a basic web.xml file within the Tomcat application development guide. Please
download this file, and place it in your local source code directory under etc/. Then, add the
file to the repository with the commands given below. As long as you have not created any
new servlets, no modifications should be necessary to the provided web.xml file. However,
the web.xml file contains a few small bugs that must be taken care of (as of the writing of
this on April 30, 2001 I am assuming they will still be there):
o Line 77: The description text contains an XML tag
recognized by Tomcat, but should not be right here. Just remove the <> symbols.
o Line 88 and 92: The end tags are wrong. Instead of , it should be
Note: The example web.xml file contains a lot of information that is not required initially.
Nevertheless, it is very useful to have an example that contains many of the available tags
After correcting the mistakes mentioned above, you should add the file to the repository.
$ cd ~/myApp/etc
$ cvs add web.xml
$ cvs commit m "Initial web.xml file added."
This concludes the set up and configuration of the development environment. In the next
section, the author will demonstrate the development and deployment of a simple application
containing one HTML page and one servlet, and look at the structure of the deployed
application in further detail.