What is a taglib?

Daron picture Daron · Dec 3, 2014 · Viewed 14.5k times · Source

Can someone explain what a taglib is in respect to Java programming? It contains a prefix and uri...but what do each of these refer to? I looked up a number of different websites but am frankly am still confused about what it is and what it does.

Answer

K.Nicholas picture K.Nicholas · Dec 3, 2014

The JavaServer Pages API allows you to define custom JSP tags that look like HTML or XML tags and a tag library is a set of user-defined tags that implement custom behavior.

The taglib directive declares that your JSP page uses a set of custom tags, identifies the location of the library, and provides a means for identifying the custom tags in your JSP page.

Original source: JSP - The taglib Directive