Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Programmatically adding tag descriptors

 
Kevin Davies
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to programmatically add a tag descriptions for a jsp rather than declaring them in a .tld? I have many tags that have the same attributes and it a pain to have to copy that same big list of attributes over and over again in the tld file. Is there a hook for doing this? I know you can do dynamic attributes, but it would nice if I didn't even have to add the tag at all to a tld file.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, custom actions must be defined in a tld file or by a tag file. In either case, you must explicitly define the attributes.
 
Kevin Davies
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by a tag file? Is that different than a .tld file?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tag files are a JSP 2.0 feature where you can write a custom action (tag) as a JSP file rather than as Java code. They are well suited for actions that emit a lot of markup and don't have to do a lot of processing (scriptlets are forbidden in tag files, so that part rather takes care of itself).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic