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.

Web Application Descriptors and Packaging

As stated in Chapter 2, web artifacts are packaged with several deployment descriptors into a web module called a WAR file. The WAR file is then packaged into an EAR. This section describes the structure of the web deployment descriptors and the structure of a WAR file.

Web Deployment Descriptors

The main deployment descriptor in a web module is the web.xml file. The web.xml file contains many settings. Code Snippet 6-5 shows the shell of web.xml. Much like the application.xml file in the EAR file, it contains the standard headers. The <web-app> tags are the parent tags of the web.xml file.