O'Reilly logo

Java EE 7 Developer Handbook by Peter A. Pilgrim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The web deployment descriptor

The web deployment descriptor XML file is the traditional method for Java web developers to configure Servlets, filters, and listeners in a Java EE application. The file must be named web.xml, and the specification mandates that it will be found in the WAR file under the folder WEB-INF/.

The web deployment descriptor describes the Servlet classes, filters, and listeners, the environment and resources, and other configurations of a web application. Putting the information all together, inform the web container how to serve the content from the incoming web requests.

The simplest possible deployment descriptor for Servlet 3.1 and beyond looks just like the following code:

<?xml version = "1.0" encoding = "ISO-8859-1"?> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required