Keith Hankin wrote:
I have been been trying to jar up a custom taglib java class along with the corresponding tld 
file. However I keep getting an error indicating that it cannot find a file named 
"META-INF/taglib.tld".

I have followed instructions in this doc: 
http://www.ibm.com/developerworks/java/library/j-jsp09023.html?ca=dgr-jw17j-jsp09023 
yet it does not seem to work properly.

I created a file myjar.jar with files as follows:

    META-INF/MANIFEST.MF
    META-INF/mytag.tld
    com/mycompany/MyTag.class

I put the jar file into my war file at WEB-INF/lib/myjar.jar

I put the following in web.xml:

  <taglib>

  <taglib-uri>

  http://mycompany.com/taglibs/mytag

  </taglib-uri>

  <taglib-location>

  /WEB-INF/lib/myjar.jar

  </taglib-location>

  </taglib>


The file mytag.tld contains the following: <?xml version="1.0" encoding="ISO-8859-1" ?>

  <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" 
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd";>

  <taglib>

  <tlibversion>1.0</tlibversion>

  <jspversion>2.0</jspversion>

  <shortname>mytag</shortname>

  <tag>

  <name>myTag1</name>

  <tagclass>com.mycompany.MyTag</tagclass>

  </tag>


</taglib>

Rename your META-INF/mytag.tld to be META-INF/taglib.tld

When the tld is contained in the jar it is expected to be META-INF/taglib.tld I believe.

Mike


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to