web-jsptaglibrary_1_2.dtd: Elements - Entities - Source | Intro - Index
FRAMES / NO FRAMES

web-jsptaglibrary_1_2.dtd


<taglib> Root element

The taglib tag is the document root, it defines:

tlib-version the version of the tag library implementation

jsp-version the version of JSP the tag library depends upon

short-name a simple default short name that could be used by a JSP authoring tool to create names with a mnemonic value; for example, the it may be used as the prefered prefix value in taglib directives

uri a uri uniquely identifying this taglib

display-name the display-name element contains a short name that is intended to be displayed by tools small-icon optional small-icon that can be used by tools

large-icon optional large-icon that can be used by tools

description a simple string describing the "use" of this taglib, should be user discernable

validator optional TagLibraryValidator information

listener optional event listener specification

<taglib>'s children
NameCardinality
descriptionOne or none
display-nameOne or none
jsp-versionOnly one
large-iconOne or none
listenerAny number
short-nameOnly one
small-iconOne or none
tagAt least one
tlib-versionOnly one
uriOne or none
validatorOne or none
<taglib>'s attributes
NameValuesDefault
idMatch the ID rules.
xmlnshttp://java.sun.com/JSP/TagLibraryDescriptor
Element's model:

(tlib-version, jsp-version, short-name, uri?, display-name?, small-icon?, large-icon?, description?, validator?, listener*, tag+)


@id Attribute of taglib

Element identifier.

Possible values: Match the ID rules.


@xmlns Attribute of taglib

XML namespace of the element.

Fixed value: http://java.sun.com/JSP/TagLibraryDescriptor


<tlib-version> Child of taglib

Describes this version (number) of the taglibrary (dewey decimal)

#PCDATA ::= [0-9]*{ "."[0-9] }0..3

<tlib-version>'s attributes
NameValuesDefault
idMatch the ID rules.

<jsp-version> Child of taglib

Describes the JSP version (number) this taglibrary requires in order to function (dewey decimal)

The default is 1.2

#PCDATA ::= [0-9]*{ "."[0-9] }0..3

<jsp-version>'s attributes
NameValuesDefault
idMatch the ID rules.

<short-name> Child of taglib

Defines a short (default) short-name to be used for tags and variable names used/created by this tag library. Do not use white space, and do not start with digits or underscore.

#PCDATA ::= NMTOKEN

<short-name>'s attributes
NameValuesDefault
idMatch the ID rules.

<uri> Child of taglib

Defines a public URI that uniquely identifies this version of the taglibrary. Leave it empty if it does not apply.

<uri>'s attributes
NameValuesDefault
idMatch the ID rules.

<description> Child of attribute, tag, taglib, init-param, variable, validator

Defines an arbitrary text string descirbing the tag library

<description>'s attributes
NameValuesDefault
idMatch the ID rules.

<validator> Child of taglib

Defines an optional validator that can be used to validate the conformance of a JSP page to using this tag library.

<validator>'s children
NameCardinality
descriptionOne or none
init-paramAny number
validator-classOnly one
Element's model:

(validator-class, init-param*, description?)


<validator-class> Child of validator

Defines the TagLibraryValidator class that can be used to validate the conformance of a JSP page to using this tag library.


<init-param> Child of validator

The init-param element contains a name/value pair as an initialization param

<init-param>'s children
NameCardinality
descriptionOne or none
param-nameOnly one
param-valueOnly one
Element's model:

(param-name, param-value, description?)


<param-name> Child of init-param

The param-name element contains the name of a parameter.

<param-name>'s attributes
NameValuesDefault
idMatch the ID rules.

<param-value> Child of init-param

The param-value element contains the value of a parameter.

<param-value>'s attributes
NameValuesDefault
idMatch the ID rules.

<listener> Child of taglib

Defines an optional event listener object to be instantiated and registered automatically.

<listener>'s children
NameCardinality
listener-classOnly one
<listener>'s attributes
NameValuesDefault
idMatch the ID rules.
Element's model:

(listener-class)


<listener-class> Child of listener

The listener-class element declares a class in the application that must be registered as a web application listener bean. See the Servlet 2.3 specification for details.

<listener-class>'s attributes
NameValuesDefault
idMatch the ID rules.

<tag> Child of taglib

The tag defines a unique tag in this tag library. It has one attribute, id.

The tag element may have several subelements defining:

name The unique action name

tag-class The tag handler class implementing javax.servlet.jsp.tagext.Tag

tei-class An optional subclass of javax.servlet.jsp.tagext.TagExtraInfo

body-content The body content type

display-name A short name that is intended to be displayed by tools

small-icon Optional small-icon that can be used by tools

large-icon Optional large-icon that can be used by tools

description Optional tag-specific information

variable Optional scripting variable information

attribute All attributes of this action

example Optional informal description of an example of a use of this tag

<tag>'s children
NameCardinality
attributeAny number
body-contentOne or none
descriptionOne or none
display-nameOne or none
exampleOne or none
large-iconOne or none
nameOnly one
small-iconOne or none
tag-classOnly one
tei-classOne or none
variableAny number
<tag>'s attributes
NameValuesDefault
idMatch the ID rules.
Element's model:

(name, tag-class, tei-class?, body-content?, display-name?, small-icon?, large-icon?, description?, variable*, attribute*, example?)


<tag-class> Child of tag

Defines the subclass of javax.serlvet.jsp.tagext.Tag that implements the request time semantics for this tag. (required)

#PCDATA ::= fully qualified Java class name

<tag-class>'s attributes
NameValuesDefault
idMatch the ID rules.

<tei-class> Child of tag

Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo for this tag. (optional)

If this is not given, the class is not consulted at translation time.

#PCDATA ::= fully qualified Java class name

<tei-class>'s attributes
NameValuesDefault
idMatch the ID rules.

<body-content> Child of tag

Provides a hint as to the content of the body of this tag. Primarily intended for use by page composition tools.

There are currently three values specified:

tagdependent The body of the tag is interpreted by the tag implementation itself, and is most likely in a different "langage", e.g embedded SQL statements.

JSP The body of the tag contains nested JSP syntax

empty The body must be empty

The default (if not defined) is JSP

#PCDATA ::= tagdependent | JSP | empty

<body-content>'s attributes
NameValuesDefault
idMatch the ID rules.

<display-name> Child of tag, taglib

The display-name element contains a short name that is intended to be displayed by tools.


<large-icon> Child of tag, taglib

The large-icon element contains the name of a file containing a large (32 x 32) icon image. The file name is a relative path within the tag library. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.


<small-icon> Child of tag, taglib

The small-icon element contains the name of a file containing a large (32 x 32) icon image. The file name is a relative path within the tag library. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.


<example> Child of tag

The example element contains an informal description of an example of the use of a tag.

<example>'s attributes
NameValuesDefault
idMatch the ID rules.

<variable> Child of tag

The variable tag provides information on the scripting variables defined by this tag. It is a (translation time) error for a tag that has one or more variable subelements to have a TagExtraInfo class that returns a non-null object.

The subelements of variable are of the form:

name-given The variable name as a constant

name-from-attribute The name of an attribute whose (translation time) value will give the name of the variable. One of name-given or name-from-attribute is required.

variable-class Name of the class of the variable. java.lang.String is default.

declare Whether the variable is declared or not. True is the default.

scope The scope of the scripting varaible defined. NESTED is default.

description Optional description of this variable

<variable>'s children
NameCardinality
declareOne or none
descriptionOne or none
name-from-attributeOne or none
name-givenOne or none
scopeOne or none
variable-classOne or none
Element's model:

((name-given | name-from-attribute), variable-class?, declare?, scope?, description?)


<name-given> Child of variable

The name for the scripting variable. One of name-given or name-from-attribute is required.


<name-from-attribute> Child of variable

The name of an attribute whose (translation-time) value will give the name of the variable. One of name-given or name-from-attribute is required.


<variable-class> Child of variable

The optional name of the class for the scripting variable. The default is java.lang.String.


<declare> Child of variable

Whether the scripting variable is to be defined or not. See TagExtraInfo for details. This element is optional and "true" is the default.


<scope> Child of variable

The scope of the scripting variable. See TagExtraInfo for details. The element is optional and "NESTED" is the default. Other legal values are "AT_BEGIN" and "AT_END".


<attribute> Child of tag

The attribute tag defines an attribute for the nesting tag

An attribute definition is composed of:

- the attributes name (required)

- if the attribute is required or optional (optional)

- if the attributes value may be dynamically calculated at runtime by a scriptlet expression (optional)

- the type of the attributes value (optional)

- an informal description of the meaning of the attribute (optional)

<attribute>'s children
NameCardinality
descriptionOne or none
nameOnly one
requiredOne or none
rtexprvalueOne or none
typeOne or none
<attribute>'s attributes
NameValuesDefault
idMatch the ID rules.
Element's model:

(name, required?, rtexprvalue?, type?, description?)


<name> Child of attribute, tag

Defines the canonical name of a tag or attribute being defined

#PCDATA ::= NMTOKEN

<name>'s attributes
NameValuesDefault
idMatch the ID rules.

<required> Child of attribute

Defines if the nesting attribute is required or optional.

#PCDATA ::= true | false | yes | no

If not present then the default is "false", i.e the attribute is optional.

<required>'s attributes
NameValuesDefault
idMatch the ID rules.

<rtexprvalue> Child of attribute

Defines if the nesting attribute can have scriptlet expressions as a value, i.e the value of the attribute may be dynamically calculated at request time, as opposed to a static value determined at translation time.

#PCDATA ::= true | false | yes | no

If not present then the default is "false", i.e the attribute has a static value

<rtexprvalue>'s attributes
NameValuesDefault
idMatch the ID rules.

<type> Child of attribute

Defines the Java type of the attributes value. For static values (those determined at translation time) the type is always java.lang.String.


@id Attribute of tlib-version

ID attributes

Possible values: Match the ID rules.


@id Attribute of jsp-version

Element identifier.

Possible values: Match the ID rules.


@id Attribute of short-name

Element identifier.

Possible values: Match the ID rules.


@id Attribute of uri

Element identifier.

Possible values: Match the ID rules.


@id Attribute of description

Element identifier.

Possible values: Match the ID rules.


@id Attribute of example

Element identifier.

Possible values: Match the ID rules.


@id Attribute of tag

Element identifier.

Possible values: Match the ID rules.


@id Attribute of tag-class

Element identifier.

Possible values: Match the ID rules.


@id Attribute of tei-class

Element identifier.

Possible values: Match the ID rules.


@id Attribute of body-content

Element identifier.

Possible values: Match the ID rules.


@id Attribute of attribute

Element identifier.

Possible values: Match the ID rules.


@id Attribute of name

Element identifier.

Possible values: Match the ID rules.


@id Attribute of required

Element identifier.

Possible values: Match the ID rules.


@id Attribute of rtexprvalue

Element identifier.

Possible values: Match the ID rules.


@id Attribute of param-name

Element identifier.

Possible values: Match the ID rules.


@id Attribute of param-value

Element identifier.

Possible values: Match the ID rules.


@id Attribute of listener

Element identifier.

Possible values: Match the ID rules.


@id Attribute of listener-class

Element identifier.

Possible values: Match the ID rules.