What is Taglib directive?

Defines the tag libraries available in jsp. It allows a jsp page to work with custom tag libraries.
<%@taglib attribute=””%>
The attribute can be,
Either an absolute or relative url specification that uniquely identifies the TLD associated with the prefix.
It specifies the directory to indicate to the container that it should evaluate any tag files that may be present. The TLD present in the specified directory is used.
It defines the prefix String that is used to access the tags(or actions) defined in the tag library.

A translation error occears if the container can not locate the TLD that is specified in the uri.
<%@taglib prefix=”mytag” tagdir=/WEB-INF/tags”%>

No comments:

Post a Comment