This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
This works fine, but what I really want the TLD to describe is that the layoutCol1 attribute can have one of the values label or field or helpicon
I've read that that I can do this at runtime by having a class that extends TagExtraInfo and writing the isValid method. But what I'd really like to do is do it in the TLD - that after all should describe my tag and all of its attributes?
There is an option of giving a "type" attribute in the attribute element.
check: SUN tutorial
However I don't know whether you can use an enum there...
Joined: Aug 18, 2004
Thanks Frits, but I dont think the type attribute is what I want (I think it is for when you allow expressions as values for your custom attribute you can say what object type the expression return should be)
There is an interesting line in the page I originally posted - in the section Attribute Validation, the first line reads:
The documentation for a tag library should describe valid values for tag attributes. When a JSP page is translated, a JSP container will enforce any constraints contained in the TLD element for each attribute.
Does anyone know what documentation they refer to? The way I am reading this is that there are some documentation tags which I should include in my TLD which (amongst other things) can describe the valid option values for an attribute?
Creator of Enthuware JWS+ V6