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 that is
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
for reference.
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.
37
Java Web Hosting Application Development Using Java Technologies Hosting
|
|
|
|
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved. |