Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

what is the use of taglib directive in jsp  RSS feed

 
mandadi vamsikrishna rao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have some confusion about taglib directive, what is the use of this one and how its different from other two called page and include.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It enables a tag library for use on the page and associates a prefix with the tags defined by the library. The file referenced by the directive is a TLD (Tag Library Descriptor) file, which is an XML file that defines the tags implemented by the library.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Include directives and statements include the result (or source) of another JSP into the current one.
Taglib directives are effectively import statements like the importing of other Java classes, completely different purpose.
 
Viniiee Math
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A tag library is a collection of custom actions. It consists of a tag library descriptor file and a set of tag handler classes. The tag library descriptor (TLD) is an XML document that maps each tag in the library to its associated tag handler. The TLD describes parameters and scripting variables associated with the tags in the tag library.
A tag library is made available to a JSP file through a taglib directive.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!