Is there any way to have a custom tag that supports a variable number of unknown attributes?

Serge Knystautas

No, you cannot place a dynamic number of attributes in the custom tag as the JSP engine expects to validate a static number of attributes. An alternate approach to this is use a series of inner tags within your outer tag that set these dynamic settings, e.g.,

  <custom:attr name="someUnknownAttr" value="1">
  <custom:attr name="someSpecialAttr" value="2">

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact