Cannot find tag library

Hi all,

I have a web application deployed on Tomcat 4.1.30 and I get the following error when I try to access it:

org.apache.jasper.JasperException: File "/sopTags" not found

It seems like it can't find the tag library, but I can't figure out why, here is a snippet from my web.xml:

<taglib>

<taglib-uri>/sopTags</taglib-uri>

<tagliblocation>/WEBINF/tlds/sop_index.tld</taglib-location>

</taglib>

and here is a snippet from my tld file:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"

"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">

<taglib>

<tlib-version>1.0</tlib-version>

<jsp-version>1.2</jsp-version>

<short-name>/sopTags</short-name>

<description>SOP Index Tag Library</description>

</taglib>

any suggestions on how to fix this or why it's happening?

[1078 byte] By [lucky456a] at [2007-10-3 7:43:33]
# 1
Check the taglib-location value in web.xml is correct.You are missing the - out of WEB-INF
evnafetsa at 2007-7-15 2:44:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Unfortunately that was just a typo in my post, there is actually a '-' in my WEB-INF value, any other ideas?
lucky456a at 2007-7-15 2:44:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Well, double check that value in web.xml anyway.

You might try putting the path directly onto your JSP:

<%@ taglib prefix="test" uri=">WEB-INF/tlds/sop_index.tld"%>

Does it work then?

Also, a better way of mapping it, rather than using web.xml is to put a uri directly into the tld file.

excerpt from JSTL c.tld:

<taglib>

<tlib-version>1.0</tlib-version>

<jsp-version>1.2</jsp-version>

<short-name>c</short-name>

<uri>http://java.sun.com/jstl/core</uri>

<display-name>JSTL core</display-name>

<description>JSTL 1.0 core library</description>

Note the uri entry?

That specifies the URI used to import the taglib onto the page.

So if you add a <uri> entry to your tld, it will get implicitly added to the taglibraries available - ie you don't need an entry in web.xml for it.

Hope this helps,

evnafets

evnafetsa at 2007-7-15 2:44:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...