O'Reilly logo

Java Servlet Programming, 2nd Edition by William Crawford, Jason Hunter

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

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 Descriptor ...

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