Wednesday, July 4, 2012

Use a TLD placed in a JAR in JSPX

If a TLD is placed inside a JAR as explained in this article then using it from inside a JSPX file is very easy.
You just need to specify it in the root node of the JSPX file. For example
<div xmlns:your_namespace="URI"
 version="2.0">
 ....
</div>
where URI is the value of the URI tag in the TLD. Referring to the tld
<?xml version="1.0" encoding="UTF-8"?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2eeweb-jsptaglibrary_2_0.xsd" version="2.0">
 <tlib-version>1.0</tlib-version>
 <uri>http://tempuri.org</uri>

 <function>
 ....
 </function>
</taglib>
URI is http://tempuri.org

Bye,
Stefano

No comments:

Post a Comment