SCWCD exam
SCWCD FAQ
Other SCWCD sites
SCWCD Books
About Java Prepare
Questions
DD
JSP
Taglibs
Servlets
EL and JSTL
JSP Tutorial
Page Directive
Include Directive
Taglib Directive
Declaration
Scriptlet
Expression
Implicit Objects
Comments
Action
Advertisements

javaprepare: JSP tutorial - Taglib Directive
SCWCD home | SCWCD questions | SCWCD links | SCJP home

javaprepare.com:JSP tutorial - Taglib Directive

SCWCD home | SCWCD questions | SCWCD links | SCJP home
If a JSP page uses one or more custom tag libraries, then it needs to use the taglib directive to specify the path of the tag library. Teh taglib directive takes two attributes as input - uri and prefix.

<@taglib uri="/mathLibraryTags" prefix="m"%>

In the above example TLD file of the tag library is specified by the /mathLibraryTags url. The is specified via the uri attribute of taglib directive. All tags in the tag library can be accessed in the JSP page by using the prefix m specified in the taglib directive. So if there is a tag called sqrt in mathLibaryTags tag library, then jsp file can access the same using <m:sqrt ...> element.