A Tab Library is described via a Tag Library Descriptor, an XML document that is described
No custom directives can be described using the JSP 1.1 specification.
The tag extension mechanism described in this chapter addresses the following goals:
An action described in a tag library must be usable in any JSP container.
Unsophisticated users must be able to understand and use this mechanism. We
would like to make it very easy for vendors of functionality to expose it through actions.
We want to enable a wide range of actions to be described in this mechanism,
Scripting elements inside the body.
Creation, use and updating of scripting variables.
Usable from different scripting languages
Although the JSP specification currently only
defines the semantics for scripting based on the Java programming language, we want to
leave open other scripting languages.
Building upon existing concepts and machinery
We do not want to reinvent machinery that
exists elsewhere. Also, we want to avoid future conflicts whenever we can predict them.
The basic mechanism for defining the semantics of an action is that of a
. A tag
handler is a Java class that implements the
interfaces and that is the run
time representation of a custom action.
The JSP page implementation class instantiates (or reuses) a tag handler object for each
action in the JSP page. This handler object is a Java object that implements the
interface. The handler object is responsible for the
interaction between the JSP page and additional server side objects.
There are two main interfaces:
defines the basic methods that are needed in all tag handlers. These methods include
setter methods to initialize a tag handler with context data and with the attribute values of
the corresponding action, and the two methods:
provides two additional methods for when the tag handler wants to manipulate
its body. The two new methods are
JavaServer Pages 1.1 Specification
November 30, 1999