Download and Installation

Binary downloads of released versions of the Apache Taglibs distributions are available from each components website.

Note that for now, these distributions are legacy versions from the Jakarta Taglibs days. While current development is built using Maven, the binary builds were created, and the source builds require, an Ant build system.

Distribution Directory Structure

The distribution archive will contain the following file and directory structure:

  • LICENSE - A copy of the Apache Software Foundation license under which all Jakarta project software is distributed.
  • README - A brief README file that contains pointers to the documentation that is available.
  • doc - A directory containing documentation about the JAKARTA-TAGLIBS project as a whole, including this file. The following documents are included:
  • A directory for each custom tag library included in the JAKARTA-TAGLIBS project, where the directory name matches the short name of that project. Each directory will contain the following files, where {library} represents that project's short name:
    • {library}.tld - The tag library descriptor file for this custom tag library. This file will normally be copied to the /WEB-INF subdirectory within your web application, and referenced with a <taglib> element in the web application deployment descriptor (/WEB-INF/web.xml) file.
    • {library}.jar - A JAR file containing the Java classes and associated resources that comprise this custom tag library. This file will normally be copied to the /WEB-INF/lib subdirectory within your web application, which makes these classes automatically visible within your application.
    • {library}-doc.war - A web application containing developer documentation describing how to use the tags in this custom tag library in your own application. This web application can be deployed and executed on any servlet container that is compatible with the Servlet API Specification, version 2.2 or later.
    • {library}-examples.war - A web application containing one or more examples that illustrate the use of this custom tag library. This web application can be deployed and executed on any servlet container that is compatible with the Servlet API Specification, version 2.2 or later.

Using a Custom Tag Library in Your Application

To use one or more of the custom tag libraries included in JAKARTA-TAGLIBS in your own web applications, follow these steps:

  • Copy the {library}.tld file to the /WEB-INF subdirectory of your web application.
  • Copy the {library}.jar file to the /WEB-INF/lib subdirectory of your web application.
  • Install additional JAR files for libraries required by the custom tag library you wish to use (see the library documentation for information) in the /WEB-INF/lib subdirectory of your web application.
  • For each tag library you are going to use, add a <taglib> element to your web application deployment descriptor (/WEB-INF/web.xml)) file. An example entry might look like this:
        <taglib>
    	<taglib-uri>http://jakarta.apache.org/taglibs/{library}</taglib-uri>
    	<taglib-location>/WEB-INF/{library}.tld</taglib-location>
        </taglib>
        
  • At the top of each JSP page in your application that needs to use one or more tags from this custom tag library, add a <%@ taglib %> directive identifying the URI of the library you want to use (which must match the value you specified in the <taglib-uri> element in the web application deployment descriptor), and the tagname prefix you will use within this page to identify tags from this library. An example entry might look like this:
        <%@ taglib uri="http://jakarta.apache.org/taglibs/{library}" prefix="x" %>
        
  • Whenever you wanted to use one of the tags from this library, you would simply include it, prefixed as you described in the taglib directive, and including attribute names and values as described in the documentation for this tag library. For example, if the library you are using has a tag named magic, and you selected the "x" prefix as described above, you would might include this custom tag:
        <x:magic/>
        
    or, if this tag required attributes and perhaps some body text:
        <x:magic id="beanName" name="xyz">
    	... Some body text and/or nested tags ...
        </x:magic>
        
  • See the documentation provided with each custom tag library for detailed descriptions of the available tags within that library.