C. Deployment Descriptor DTD Reference

Java Servlet Programming, 2nd Edition > C. Deployment Descriptor DTD Reference

 
< BACKCONTINUE >

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.

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 DTD
<!ELEMENT web-app (icon?, display-name?, description?, distributable?,                    context-param*, servlet*, servlet-mapping*, session-config?,                    mime-mapping*, welcome-file-list?, error-page*, taglib*,                    resource-ref*, security-constraint*, login-config?,                     security-role*, env-entry*, ejb-ref*)> <!ELEMENT icon (small-icon?, large-icon?)> <!ELEMENT small-icon (#PCDATA)> <!ELEMENT large-icon (#PCDATA)> <!ELEMENT display-name (#PCDATA)> <!ELEMENT description (#PCDATA)> <!ELEMENT distributable EMPTY> <!ELEMENT context-param (param-name, param-value, description?)> <!ELEMENT param-name (#PCDATA)> <!ELEMENT param-value (#PCDATA)> <!ELEMENT servlet (icon?, servlet-name, display-name?, description?,                    (servlet-class|jsp-file), init-param*, load-on-startup?,                    security-role-ref*)> <!ELEMENT servlet-name (#PCDATA)> <!ELEMENT servlet-class (#PCDATA)> <!ELEMENT jsp-file (#PCDATA)> <!ELEMENT init-param (param-name, param-value, description?)> <!ELEMENT load-on-startup (#PCDATA)> <!ELEMENT servlet-mapping (servlet-name, url-pattern)> <!ELEMENT url-pattern (#PCDATA)> <!ELEMENT session-config (session-timeout?)> <!ELEMENT session-timeout (#PCDATA)> <!ELEMENT mime-mapping (extension, mime-type)> <!ELEMENT extension (#PCDATA)> <!ELEMENT mime-type (#PCDATA)> <!ELEMENT welcome-file-list (welcome-file+)> <!ELEMENT welcome-file (#PCDATA)> <!ELEMENT taglib (taglib-uri, taglib-location)> <!ELEMENT taglib-uri (#PCDATA)> <!ELEMENT taglib-location (#PCDATA)> <!ELEMENT error-page ((error-code | exception-type), location)> <!ELEMENT error-code (#PCDATA)> <!ELEMENT exception-type (#PCDATA)> <!ELEMENT location (#PCDATA)> <!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth)> <!ELEMENT res-ref-name (#PCDATA)> <!ELEMENT res-type (#PCDATA)> <!ELEMENT res-auth (#PCDATA)> <!ELEMENT security-constraint (web-resource-collection+,                                auth-constraint?, user-data-constraint?)> <!ELEMENT web-resource-collection (web-resource-name, description?,                                    url-pattern*, http-method*)> <!ELEMENT web-resource-name (#PCDATA)> <!ELEMENT http-method (#PCDATA)> <!ELEMENT user-data-constraint (description?, transport-guarantee)> <!ELEMENT transport-guarantee (#PCDATA)> <!ELEMENT auth-constraint (description?, role-name*)> <!ELEMENT role-name (#PCDATA)> <!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)> <!ELEMENT realm-name (#PCDATA)> <!ELEMENT form-login-config (form-login-page, form-error-page)> <!ELEMENT form-login-page (#PCDATA)> <!ELEMENT form-error-page (#PCDATA)> <!ELEMENT auth-method (#PCDATA)> <!ELEMENT security-role (description?, role-name)> <!ELEMENT security-role-ref (description?, role-name, role-link)>  <!ELEMENT role-link (#PCDATA)> <!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,                      env-entry-type)> <!ELEMENT env-entry-name (#PCDATA)> <!ELEMENT env-entry-value (#PCDATA)> <!ELEMENT env-entry-type (#PCDATA)> <!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, home, remote,                     ejb-link?)> <!ELEMENT ejb-ref-name (#PCDATA)> <!ELEMENT ejb-ref-type (#PCDATA)> <!ELEMENT home (#PCDATA)> <!ELEMENT remote (#PCDATA)> <!ELEMENT ejb-link (#PCDATA)> <!-- The ID mechanism is to allow tools to easily make tool-specific references to the elements of the deployment descriptor.  This allows tools that produce additional deployment information (i.e., information beyond the standard deployment descriptor information) to store the nonstandard information in a separate file and easily refer from these tools-specific files to the information in the standard web-app deployment descriptor. --> <!ATTLIST web-app id ID #IMPLIED> <!ATTLIST icon id ID #IMPLIED> <!ATTLIST small-icon id ID #IMPLIED> <!ATTLIST large-icon id ID #IMPLIED> <!ATTLIST display-name id ID #IMPLIED> <!ATTLIST description id ID #IMPLIED> <!ATTLIST distributable id ID #IMPLIED> <!ATTLIST context-param id ID #IMPLIED> <!ATTLIST param-name id ID #IMPLIED> <!ATTLIST param-value id ID #IMPLIED> <!ATTLIST servlet id ID #IMPLIED> <!ATTLIST servlet-name id ID #IMPLIED> <!ATTLIST servlet-class id ID #IMPLIED> <!ATTLIST jsp-file id ID #IMPLIED> <!ATTLIST init-param id ID #IMPLIED> <!ATTLIST load-on-startup id ID #IMPLIED> <!ATTLIST servlet-mapping id ID #IMPLIED> <!ATTLIST url-pattern id ID #IMPLIED> <!ATTLIST session-config id ID #IMPLIED> <!ATTLIST session-timeout id ID #IMPLIED> <!ATTLIST mime-mapping id ID #IMPLIED> <!ATTLIST extension id ID #IMPLIED> <!ATTLIST mime-type id ID #IMPLIED> <!ATTLIST welcome-file-list id ID #IMPLIED> <!ATTLIST welcome-file id ID #IMPLIED> <!ATTLIST error-page id ID #IMPLIED> <!ATTLIST error-code id ID #IMPLIED> <!ATTLIST exception-type id ID #IMPLIED> <!ATTLIST location id ID #IMPLIED> <!ATTLIST resource-ref id ID #IMPLIED> <!ATTLIST res-ref-name id ID #IMPLIED> <!ATTLIST res-type id ID #IMPLIED> <!ATTLIST res-auth id ID #IMPLIED> <!ATTLIST security-constraint id ID #IMPLIED> <!ATTLIST web-resource-collection id ID #IMPLIED> <!ATTLIST web-resource-name id ID #IMPLIED> <!ATTLIST http-method id ID #IMPLIED> <!ATTLIST user-data-constraint id ID #IMPLIED> <!ATTLIST transport-guarantee id ID #IMPLIED> <!ATTLIST auth-constraint id ID #IMPLIED> <!ATTLIST role-name id ID #IMPLIED> <!ATTLIST auth-method id ID #IMPLIED> <!ATTLIST basic-auth id ID #IMPLIED> <!ATTLIST form-auth id ID #IMPLIED> <!ATTLIST form-login-page id ID #IMPLIED> <!ATTLIST form-error-page id ID #IMPLIED> <!ATTLIST form-login-config id ID #IMPLIED> <!ATTLIST realm-name id ID #IMPLIED> <!ATTLIST login-config id ID #IMPLIED> <!ATTLIST security-role id ID #IMPLIED> <!ATTLIST security-role-ref id ID #IMPLIED> <!ATTLIST role-link id ID #IMPLIED> <!ATTLIST env-entry id ID #IMPLIED> <!ATTLIST env-entry-name id ID #IMPLIED> <!ATTLIST env-entry-value id ID #IMPLIED> <!ATTLIST env-entry-type id ID #IMPLIED> <!ATTLIST mutual-auth id ID #IMPLIED> <!ATTLIST ejb-ref id ID #IMPLIED> <!ATTLIST ejb-ref-name id ID #IMPLIED> <!ATTLIST ejb-ref-type id ID #IMPLIED> <!ATTLIST home id ID #IMPLIED> <!ATTLIST remote id ID #IMPLIED> <!ATTLIST ejb-link id ID #IMPLIED>


Last updated on 3/20/2003
Java Servlet Programming, 2nd Edition, © 2001 O'Reilly

< BACKCONTINUE >


Java servlet programming
Java Servlet Programming (Java Series)
ISBN: 0596000405
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net