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.
The moose likes JSP and the fly likes Programmatically adding tag descriptors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Programmatically adding tag descriptors" Watch "Programmatically adding tag descriptors" New topic
Author

Programmatically adding tag descriptors

Kevin Davies
Greenhorn

Joined: Jun 20, 2005
Posts: 14
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

Joined: Jan 10, 2002
Posts: 63350
    
  70

No, custom actions must be defined in a tld file or by a tag file. In either case, you must explicitly define the attributes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kevin Davies
Greenhorn

Joined: Jun 20, 2005
Posts: 14
What do you mean by a tag file? Is that different than a .tld file?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63350
    
  70

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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Programmatically adding tag descriptors
 
It's not a secret anymore!