Anurag Gupta wrote:
>
> Hi All,
>
> Does anybody have experience with the JSP taglib? I am trying to use
> taglib, but running into the problems. I am getting the following error
> message:
>
> Could not locate TLD META-INF/taglib.tld
>
> BTW, I am using Tomcat and Apachi. Do I need to configure Tomcat to
> be able to use taglib? I noticed that there was no directory, named
> META-INF under webapps. I created one by this name and moved my .tld file
> in this directory, but, it didn't help.
If you look in the JSP 1.1 specification (plus the errata for the spec),
you see that there are three ways to identify the TLD for a tag library.
In all cases you need a taglib directive in the JSP page:
<%@ taglib uri="something" prefix="myprefix" %>
It's how "something" is interpreted that's interesting. It can be one
of three things:
1) A symbolic name, e.g. "/mytaglib". The JSP container looks in the
web.xml
file for a <taglib> element with a nested <taglib-uri> element that
has the same value as the uri attribute in the taglib directive. If
it finds one, it uses the path specified by the <taglib-location>
subelement to locate the TLD. The path found this way can be of one
of the two types described in 2) and 3).
2) A path to the TLD file itself, e.g. /WEB-INF/tlds/mylib.tld.
3) A path to a JAR file that contains the TLD (plus all tag library
classes). In this case, the TLD must be located in the
META-INF/taglib.tld file within the JAR file.
So, the error message you get means that the uri attribute doesn't
follow one of the three rules. It sounds like you use path to a
tag library JAR file, and that this JAR file doesn't contain the
TLD (at least not in META-INF/taglib.tld).
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets