The JSP specification supports scripting variables that can be declared within a scriptlet and
can be used in another. The actions in a JSP page also can be used to define scripting
variables so they can used in scripting elements, or in other actions; for example, the
jsp:useBean standard action may define an object which can later be used through a scripting
Since the logic that decides whether an action instance will define a scripting variable may
be quite complex, this information is not encoded in the Tag Library Descriptor directly;
rather, the name of a
class is given in the TLD and the
method is used at translation time to obtain information on each
variable that will be created at request time when this action is executed. The method is
instance that contains the translation time attribute values.
The result of the invocation on
is an array of
objects. Each such object describes a scripting variable by providing its name, its type,
whether the variable is new or not, and what its scope is. Scope is best described through a
The defined values for scope are:
, if the scripting variable is available between the start tag and the end tag of the
action that defines it.
, if the scripting variable is available from the start tag of the action that
defines it until the end of the page.
, if the scripting variable is available after the end tag of the action that defines
it until the end of the page.
The scope value for a variable implies what methods
affect its value and thus, in lack of
additional information, where synchronization is needed: