File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Java 8 in Action this week in the Java 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: 60071
    
  65

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: 60071
    
  65

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
 
Similar Threads
Doubts in Dynamic Attributes
tld question
TLD for custom JSF UI component
Clean up TLD for custom components
Freemarker support for JSP taglibs in JForum