• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts in Dynamic Attributes

 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....?
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Dynamic Attributes come in there!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic