I am brand new at trying tag library development and am trying to build a simple custom tag using Netbeans 4.1 and I get the following error when running the
JSP and when inside the Netbeans
IDE:
Error:
File "/WEB-INF/JavascriptExampleTag.tld" not found
Note, the tld is in the WEB-INF directory and the tag handler is in directory com.jspinsider.jspkit.javascript
Here is my tld, with web-xml and JSP taglib declaration to follow:
tld:
<?xml version="1.0" encoding="UTF-8"?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd" version="2.0">
<tlib-version>1.0</tlib-version>
<short-name>JavaScriptExampleTag</short-name>
<uri>
http://linux:8084/jspkit/javascript</uri>
<tag>
<name>message</name> <tag-class>com.jspinsider.jspkit.javascript.JavaScriptExampleTag</tag-class> <body-content>JSP</body-content>
</tag>
</taglib>
web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>
http://linux:8084/jspkit/javascript</taglib-uri>
<taglib-location>/WEB-INF/JavascriptExampleTag.tld</taglib-location>
</taglib>
</web-app>
JSP Declaration:
<%@taglib uri="http://linux:8084/jspkit/javascript" prefix="JavaScript"%>
JSP Attempt to use tag:
<JavaScript:message>
Simple Alert
</JavaScript:message>
This simple tag is coded and has the same deirectory structure exactly as depicted in Wrox Professional JSP 2nd Edition tutorial. I have been at this four many hours. Any help greatly appreciated. Thanks.
[ January 19, 2006: Message edited by: Bear Bibeault ]