APPENDIX B

The Web.xml File

In this appendix, we discuss the web application deployment descriptor, or web.xml file. The web.xml file is an XML file, defined by the servlet specification, with the purpose of acting as a configuration file for a web application. This file and its elements are completely independent of the Tomcat container. In this appendix, we will explain the Servlet 3.0 specific annotation based configuration that can be used instead of some web.xml configuration elements.

The Basic web.xml Configuration

The minimum requirements for web deployment descriptor is to have opening and closing <webapp> elements including Servlet API namespaces and schema definitions. Listing B-1 illustrates the minimal web.xml configuration file. ...

Get Apache Tomcat 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.