Howdy, Your web application in tomcat 4.x must have a deployment descriptor (web.xml), or else tomcat won't run it. Your file may be nearly empty, but it must be present nonetheless.
See the Servlet Specification, chapter 13, describing the deployment descriptor and its uses. The spec is available here http://java.sun.com/products/servlet/index.html As for best practices: they vary as much as your application does. One best practice that's mentioned frequently is to define and map all your servlets (using <servlet> and <servlet-mapping>) elements in your web.xml. Another possibly good idea is to encapsulate functionality like the logging of request processing time, response compression, and other stuff outside your main application logic into filters. These filters of course must be defined and configured in your web.xml file. Yet another good idea, sometimes priceless in that there's no other way to do it, is using the servlet 2.3 listeners to accomplish stuff on server startup and shutdown. See the documentation for javax.servlet.ServletContextListener and the other listener interfaces in that package. Listeners must also be defined in your web.xml file. Finally, if you have external JNDI data sources, consider defining them in your web.xml (using <env-entry> tags etc.) file such that server administrators can fill in values using the <Environment> tags in server.xml. Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Jake Robb [mailto:[EMAIL PROTECTED] >Sent: Friday, March 07, 2003 10:45 AM >To: Tomcat Users List >Subject: web.xml > >Where might I find good documentation on what exactly the contents of >web.xml need to be? I've found a basic syntactical description, but is >there something that gives examples, describes what exactly the purpose of >web.xml is, what you can accomplish with it, when it is read, etc.? > >My current production setup, with Tomcat 4.0.4, has no web.xml files and >works perfectly. Is web.xml new in 4.1? What functionality does it offer >that you couldn't accomplish in 4.0? > >Thanks, > >Jake > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
