I have just gone thru' the Dynamic Attributes, but I didn't get it. Why we are using dynamic attributes...
For example, I am having the custom tag with some my own defined attributes and some are html attributes... for my attributes, I have to make an entry at .tld file and the setter method in the tag handler..
for the html attributes, no need of entry in the .tld file and the setter method in the tag handler and instead I have to use dynamic-attribute entry in .tld file and implement dynamic attribute interface in the tag handler..
so whether my assumption is correct..? dynamic attribute is only for the predefined attributes in the html....?
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
I think you have read Bryan's document for dynamic attributes but have misinterpreted the concept.
In general, Dynamic Attributes can be used for any custom tag.
If you are sure of some attributes that your custom tag might take, you may declare them in the TLD. You can make them mandatory, allow expression evaluvation for the values they may take et al. These are all provided to you by the TLD.
What if you are in a scenario where you have some unknown attributes. Say JSP page designers might like to add new attributes in addition to what is declared in TLD.