Appendix C. Deployment Descriptor DTD Reference

A Document Type Definition (DTD) file dictates what is valid content within an XML file. This appendix provides the official DTD for the Servlet API 2.2 web application deployment descriptor. DTD files are not XML, but the syntax is easy to follow: each <!ELEMENT> tag defines in parentheses which child elements it may have, how many of each child it may have, and in what order. A question mark (?) after a child’s name means the child is optional (0 - 1), an asterisk (*) means the child may appear any number of times (0 - n), a plus sign (+) means some number of children must appear (1 - n), and no following character means the child is simply required (1). The syntax (x|y) means either x or y. The children of an element must follow the exact order listed within the parentheses.

Figures Figure C-1 through Figure C-4 graphically demonstrate the element structure; Example C-1 shows the DTD itself. Each <!ATTLIST> tag controls the allowed attributes for an element. In this DTD, the tag is used only to provide default id values. The rest of this appendix is reference material for the elements in the DTD.

The element structure of the deployment descriptor DTD

Figure C-1. The element structure of the deployment descriptor DTD

Figure C-2. 

Figure C-3. 

Figure C-4. 

Example C-1. The Deployment ...

Get Java Servlet Programming, 2nd Edition 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.