Pages

Tuesday, May 28, 2013

CQ5/AEM how to create and use a custom taglib - part 2 create and set up your TLD

If you have not already completed part I, click here.

The next step is to created your .tld directory.

In the taglib project, you will see under src/main/resources, that you have a META-INF directory.

In this directory, create a file named ProjectTaglib.tld

Add the following to this file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<taglib xmlns="http://java.sun.com/xml/ns/javaee" version="2.1">
    <tlib-version>5.4.0-SNAPSHOT</tlib-version>
    <short-name>btes</short-name>
    <uri>http://btes.com.au/tagexample</uri>
    <tag>
        <name>customTag</name>
        <tag-class>au.com.btes.tagexample.CustomTag</tag-class>
        <body-content>empty</body-content>
        <attribute>
  <name>content</name>
  <required>true</required>
</attribute>
<attribute>
  <name>isHeading</name>
  <required>true</required>
</attribute>
    </tag>
</taglib>

For Part III, click here



1 comment:

  1. The idea about the how to create and use a custom taglib - and setting up the TLD was very clear to me,I hope that it can help my federal resume writing service tld.

    ReplyDelete