Using TagLibraries in Tomcat, Where should I include the taglibrarydescriptor files (.tld file)?

Alessandro A. Garbagnati

Following JSP 1.1 specifications, the tld file should be named "taglib.tld" and should be located under /META-INF.

This structure is important if you would like to create a jar file containing all your tags, that is very useful when you have multiple tags coming from multiple sources, because you can specify the different libraries in your jsp pages like this:

<%@ taglib uri="/WEB-INF/lib/kzmCommonTags.jar" prefix="kCommon" %>
<%@ taglib uri="/WEB-INF/lib/kzmMyPhotos-tags.jar" prefix="kMP" %>

If you don't have any jar file, you can name the tag library descriptor anyway you like and put it into the /META-INF or the /WEB-INF location, for example, and use the taglib directive for specifying the right location:

<%@ taglib uri="/WEB-INF/myTags.tld" prefix="myTags" %>

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact