Ismael Blesa Part wrote:
> 
> On my jsp I use invoke the taglib with:
> <%@ taglib uri="/isumtags.jar" prefix="isum" %>

Above line tells that "uri" points out either to an entry in
WEB-INF/web.xml file called /isumtags.jar being inside
<taglib-location>'s or references /isumtags.jar directly as tag library
descriptor for tags prefixed with "isum". "prefix" attribute is being
used as a namespace for defined tags. Thus, you could use user-defined
tags as follows:

<isum:mytag />

mytag in that case must be defined in tag library descriptor file as
<name>.

> 
> Then on the web.xml  what should I put?
> 

>           <taglib>
>                <taglib-uri>/isumtags.jar</taglib-uri>
> 
> <taglib-location>/WEB-INF/lib/isumtags.jar</taglib-location>
>           </taglib>

Given that isumtags.jar is just archive with new tags, it should look
like:

<taglib>
  <taglib-uri>/isumtags.ar</taglib-uri>
  <taglib-location>/WEB-INF/isumtags.tld</taglib-location>

and isumtags.tld is a tag library descriptor which describes to servlet
container how tags being defined there should be used - attributes, etc.

As an example isumtags.tld could look like:

<taglib>
        <tlibversion>1.0</tlibversion>
        <shortname>My tags</shortname>
        <tag>
                <name>mytag</name>
                <tagclass>my.package.with.MyTag</tagclass>
                <bodycontent>JSP</bodycontent>
                <info></info>
                <attribute>
                        <name>name</name>
                        <required>false</required>
                        <rtexprvalue>false</rtexprvalue>
                </attribute>
        </tag>
</taglib>

Having done that, start using tags from isumtags.tld as:

<isum:mytag name="MyNotRequiredAttributeValue" />

Keep in mind that corresponding classes should be reachable in
WEB-INF/lib (as JAR) or WEB-INF/classes (as oridinary Java classes)
directory. Another point of interest is to give more descriptive name
for <taglib-uri> tag rather then a name which could be misunderstand as
Java ARchive.

Take a look at JSP Specification 1.1 (http://java.sun.com/products/jsp)
if you need more *understandable* information on it.

Jacek Laskowski

Reply via email to