Mayuresh Kadu wrote:
>
> Try changing the line
>
>     <taglib-location>/WEB-INF/tlds/taglib16.tld </taglib-location>
>
> to
>
>     <taglib-location>./WEB-INF/tlds/taglib16.tld </taglib-location>
>                            ^--- *Additional
>
> Mayuresh

I'm afraid you're wrong.

There are three spec compliant ways to identify the TLD for a tag
library, all through the uri attribute of the taglib directive in
the JSP file:

1) <%@ taglib uri="/path-to-TLD" prefix="foo" %>
   The uri attribute value is the context-relative (i.e. interpreted
   relative to the document root for the context/application) if it
   starts with a slash, otherwise relative to the page that contains
   the taglib directive. It's the path to the TLD file itself.
   This should work with any JSP 1.1 container.
2) <%@ taglib uri="/path-to-taglib-JAR" prefix="foo" %>
   The path is interpreted as in 1), but is the path to a JAR file
   that contains the TLD in META-INF/taglib.tld, as well as all
   class files for the library. This is a pretty recent clarification
   of the JSP 1.1 spec, so some early container implementations may
   not support it yet.
3) <%@ taglib uri="/symbolic-name" prefix="foo" %>
   Here the uri attribute is just a unique name that's mapped to the
   location by a <taglib> element in the web.xml file for the
   application:

     <taglib>
       <taglib-uri>/symbolic-name</taglib-uri>
       <taglib-location>/path-to-TLD-orJAR-as-above</taglib-location>
     </taglib>

Note that in 3), the "/symbolic-name" string used in the JSP page
and in the web.xml must match exactly, including case, leading slash,
etc., and that the <taglib-location> value should always start with
a slash and is interpreted as a context-relative path, e.g.
"<taglib-location>/WEB-INF/lib/mytags.tld</taglib-location>"

Hans
PS.For more about this, and a lot of other things, you may want to read
my JSP book: <http://TheJSPBook.com/>

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of sufi malak
> Sent: Monday, March 19, 2001 10:09 PM
> To: [EMAIL PROTECTED]
> Subject: Are taglibs working in tomcat4 ?????
>
> I am trying to learn taglibs under tomcat4, but I got this error :
> A Servlet Exception Has Occurred
> org.apache.jasper.JasperException: File "/taglib16.tld" not found
>
> This is what I have under tomcat4 :
> webapps\portal.jsp
> webapps\first.jsp
> webapps\second.jsp
> webapps\WEB-INF\lib\porttag.jar
> webapps\WEB-INF\tlds\taglib16.tld
> webapps\WEB-INF\web.xml
>
> The web.xml is :
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
>   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
>
> <web-app>
>   <!-- The Welcome File List -->
>   <welcome-file-list>
>     <welcome-file>portal.jsp</welcome-file>
>   </welcome-file-list>
>   <!-- Template Tag Library Descriptor -->
>   <taglib>
>     <taglib-uri>/WEB-INF/tlds/taglib16.tld </taglib-uri>
>     <taglib-location>/WEB-INF/tlds/taglib16.tld </taglib-location>
>   </taglib>
> </web-app>
>
> Thanks
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.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
>
> ===========================================================================
> 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

--
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

Reply via email to