The <set> Element
Purpose
The <set> element is used to define a variable. Variables may be subsequently used in dynamic attribute expressions. The required var attribute is used to specify the variable name.
A variable's scope may be specified using the optional scope attribute. Valid values are
- local – A local variable is visible below its declaration, inside the element tree rooted at the <set>'s parent element.
- module – A variable with module scope is saved as a module context attribute.
- application – A variable with application scope is saved as a servlet context attribute.
A variable's scope may be specified using the optional scope attribute. Valid values are local, module and application. The default scope is local. When evaluating dynamic attribute expressions, identifiers are resolved to local, module and application scope variables (in that order).
The variable value may be specified either by the value attribute, a nested object or member element.
Attributes
| Name | Type | Description |
|---|---|---|
| var | CDATA | Required - The variable name. |
| value | CDATA | Dynamic - The variable value. Alternatively, a value may be specified by a nested object or member element. |
| scope | local|
module| application |
The variable scope. Default scope is local (block visibility). |
Body
The body of the <set> element is defined by the following sequence:
(object|member)?


