Customizing Tag Attributes
See Also
Use the Add New Tag Attribute dialog box to create tag attributes
and the Tag Attribute Customizer dialog box to edit existing tag attributes.
To add a tag attribute:
- In the Explorer, right-click the tag element to which you want to add
an attribute.
- Choose Add Tag Attribute from the contextual menu.
- In the New Tag Attribute dialog box, specify the attribute. See Tag
Attribute Information.
- Click OK.
To edit an existing tag attribute:
- In the Explorer, 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.
Alternatively,
- Double-click the attribute to be customized. The contents of the Tag Attribute
Customizer
reflect the properties of the selected attribute. 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.
For more information about creating and using custom tag attributes, see JavaServer
Pages Specification, Version 1.2 available at http://java.sun.com/products/jsp.
Legal Notices