background image

Dynamic Attribute Example

<< Two Fragment Attributes | Tag Library Descriptors >>
<< Two Fragment Attributes | Tag Library Descriptors >>

Dynamic Attribute Example

Dynamic Attribute Example
The following code implements the tag discussed in
"Dynamic Attributes" on page 230
. An
arbitrary number of attributes whose values are colors are stored in a Map named by the
dynamic-attributes
attribute of the tag directive. The JSTL forEach tag is used to iterate
through the Map and the attribute keys and colored attribute values are printed in a bulleted list.
FIGURE 8­2
Book Catalog
Encapsulating Reusable Content Using Tag Files
The Java EE 5 Tutorial · September 2007
246