Sun Java System Web Server 7.0 Developer's Guide to Java Web Applications

The sun-web-app_2_4-1.dtd File

The sun-web-app_2_4-1.dtd file defines the structure of the sun-web.xml file, including the elements it can contain and the subelements and attributes these elements can have. The sun-web-app_2_4-1.dtd file is located in the install_dir/lib/dtds directory.


Note –

Do not edit the sun-web-app_2_4-1.dtd file. Its contents change only with new versions of Sun Java System Web Server 7.0.


For general information about DTD files and XML, see the XML specification at http://www.w3.org/TR/2004/REC-xml-20040204.

Each element defined in a DTD file, which might be present in the corresponding XML file can contain subelements, and attributes described in the following sections.

Subelements

Elements can contain subelements. For example, the following file fragment defines the cache element:

<!ELEMENT cache (cache-helper*, default-helper?, property*, cache-mapping*)>

The ELEMENT tag specifies that a cache element can contain cache-helper, default-helper, property, and cache-mapping subelements.

The following table shows how optional suffix characters of subelements determine the requirement rules, or number of allowed occurrences, for the subelements.

Table A–1 Requirement Rules and Subelement Suffixes

Subelement Suffix 

Requirement Rule 

element*

Can contain zero or more of this subelement.

element?

Can contain zero or one of this subelement.

element+

Must contain one or more of this subelement.

element (no suffix)

Must contain only one of this subelement.

If an element cannot contain other elements, EMPTY or (#PCDATA) appears instead of a list of element names in parentheses.

Data

Some elements contain character data instead of subelements. These elements have definitions of the following format:

<!ELEMENT element-name (#PCDATA)/>

For example:

<!ELEMENT description (#PCDATA)/>

In the sun-web.xml file, white space is treated as part of the data in a data element. Therefore, no extra white space should appear before or after the data delimited by a data element. For example:

<description/>class name of session manager</description>

Attributes

Elements that have ATTLIST tags contain attributes (name-value pairs). For example:

<!ATTLIST     cachemax-capacity CDATA     "4096"
              timeout           CDATA     "30"
              enabled           %boolean; "false">
A cache element can contain max-capacity, timeout, and enabled attributes.

The #REQUIRED label means that a value must be supplied. The #IMPLIED label means that the attribute is optional, and that Sun Java System Web Server 7.0 generates a default value. Wherever possible, explicit defaults for optional attributes (such as "true") are listed.

Attribute declarations specify the type of the attribute. For example, CDATA means character data, and %boolean is a predefined enumeration.