Creating and Editing Tag Attributes
See Also
Use the Add New Tag Attribute dialog box to add an attribute element
to a tag element in a TLD file. You can edit the properties
of a tag attribute using the Tag
Attribute Customizer dialog box. When you use the Generate Tag Handlers action
on the tag, the IDE creates template code for the attribute in the generated
Java source file.
|
Only TLD files that conform to JSP 1.1 or 1.2 specifications
can be edited in the customizer. Other versions are treated as XML files
and must be edited in the Source Editor.
|
To add a tag attribute to the TLD file:
- In the Filesystems window, right-click the tag element's node and choose
Add Tag Attribute from the contextual menu.
- In the New Tag Attribute dialog box, specify the attribute. See Tag
Attribute Information later in this topic.
- Click OK.
To edit an existing tag attribute:
- In the Filesystems window, right-click the attribute, and choose Customize
from the contextual menu.
- In the Tag Attribute Customizer dialog box, edit the attribute.
- Click OK to have the changes take effect immediately and dismiss the Tag
Attribute Customizer, or click Apply to apply the changes without dismissing
the dialog box.
Once a Tag Attribute Customizer is displayed, it tracks
the selection and shows the properties of any attribute that is selected.
Tag Attribute Information
- Name. Specifies the name of the attribute. The default value is newAttribute<n>,
where <n> can be blank or can be an integer that makes the
attribute name unique. You can edit the name.
- Required Attribute. If checked, specifies that the attribute must
be given an argument whenever the tag is called. Set to False by
default.
- Value evaluated at request time. A radio button, which, if selected,
specifies that the value of the attribute can be dynamically calculated at
request time. Set to True by default. Mutually exclusive with the
Value evaluated at JSP translation time attribute.
- Value evaluated at JSP translation time. A radio button, which, if
selected, specifies that the value of the attribute is static and determined
at translation time. Set to False by default. Mutually exclusive
with the Value evaluated request time attribute.
- Default Attribute Value. Specifies a default value for the attribute.
- Associated Java Variable Name. Specifies the name of the associated
Java variable. You need to use this field only when the name of the attribute
is not a valid Java variable, such as "default." When the
field is left blank, the associated Java variable in the generated code defaults
to the attribute name.
- Associated Java Variable Type. Specifies the type of the associated
Java variable.
- Attribute value is used as reference ID. A radio button indicating
that the generated tag handler is to contain code that places the tag instance
into the Page Context under the indicated scope using the value of the attribute
as the key. The tag can then be looked up by another tag that has an attribute
set to "Refers to Tag" for this tag type. When set to True,
the scope parameter becomes active. Set to False by default. Mutually
exclusive with Attribute value Refers to tag or class and Is
none of the above attributes.
- Scope. Specifies the scope when the attribute value is used as the
reference ID. Scope can be Page, Request, Session,
or Application. The default is Session.
- Attribute value Refers to tag or class. A radio button that indicates
the generated tag handler is to contain code that looks up a tag or class
of the specified type in the Page Context under the indicated scope. When
set to True, the type, variable name, and scope parameters become
active. Set to False by default. Mutually exclusive with the Attribute
value is used as reference ID and Is none of the above attributes.
- Type. Specifies the name of the class being referred to. Choose a
class name from the combo box or type one yourself. The default is blank.
- Variable Name. Specifies the name of the variable that is to be used
to refer to the referenced tag. The default value is <type>_ref
where <type> is the type from the Type parameter.
- Scope. Specifies the scope when the attribute value refers to a class.
Scope can be Page, Request, Session, or Application.
The default is Session.
- Is none of the above. Specifies that the attribute is not used as
a reference ID and does not refer to a tag or class. Selected by default.
Legal Notices