• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Doubts in Dynamic Attributes

 
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....?
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic