What about Tag Files?

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.

image with no caption

Get Head First Servlets and JSP, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.