aspose file tools*
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 Spring in Action this week in the Spring 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: 61433
    
  67

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: 61433
    
  67

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).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Programmatically adding tag descriptors