Tag Files can also include dynamic attributes. The mechanism is basically the same, but with Tag Files the JSP engine provides the Map
object for you. You can then inspect or iterate over that map of attribute/value pairs using the forEach
JSTL tag.
Bullet Points
The DynamicAttributes
interface allows the tag handler class to accept any number of tag attributes.
The tag declaration in the TLD must include the <dynamic-attributes>
element.
Explicit tag attributes must have a setter method.
Typically, you will use a hashmap to store the dynamic attribute name/value pairs using the setDynamicAttribute()
method.
Tag Files may also use dynamic attributes.
Use the dynamic-attributes
attribute of the tag directive.
The value of dynamic-attributes
holds a hashmap of the dynamic attributes.
Typically, you will use the JSTL forEach
custom action to iterate over this map.