Ah, so the container *should* locate the classes from the .tld and make the proper imports in the gen'd servlet for the .jsp page.
I'm using
Tomcat 4.0.1, same result on RH7 Linux as on Mac OS X 10.1.5.
Here's the error message:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 10 in the jsp file: /javascript.jsp
Generated servlet error:
/usr/local/downloads/jakarta/jakarta-tomcat-4.0.1/work/localhost/TaglibTest/javascript$jsp.java:63: Class org.apache.jsp.JavaScriptExampleTag not found.
JavaScriptExampleTag _jspx_th_js_message_0 = new JavaScriptExampleTag();
^
This is based on a simple example from Wrox's Pro JSP book.
The JavaScriptExampleTag.class is indeed inside WEB-INF/classes, and the .tld is in WEB-INF.
Without an import directive, the above error results. With an import directive, the error is avoided, tag works as expected.
The jsp code is (import commented out here):
<%-- <%@ page import="JavaScriptExampleTag" %> --%>
<%@ taglib uri="http://www.mydomain.com/jspkit/javascript" prefix="js" %>
<html>
<head>
</head>
<body>
<p>This is a simple javascript tag
test page</p>
<js:message>
This is the body of the js:message tag
</js:message>
</body>
</html>