Servlet Deployment and Web Archives

A descriptor based on XML is used in the deployment of servlets on a Web server. The compiled servlet class, additional supporting Java classes, and the deployment descriptor are packaged together into a Web archive file, also known as a “.war” file.

The deployment descriptor is an XML-based file that contains specific configuration and deployment information for use by the servlet container.

Figure 10-11 shows an example of a vanilla XML deployment descriptor for an HttpServlet. Additional required fields in the descriptor are filled in during configuration and deployment on the Web server.

Figure 10-11. A simple vanilla XML deployment descriptor for a sample HttpServlet
 <?xml version="1.0" encoding="UTF-8"?> ...

Get Developing Enterprise Java Applications with J2EE™ and UML 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.