Taglib问题:JSP Parsing Error:File "/demotag" not found
mytag.tld存放在WEB-INF/tlds下,内容:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<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">
<description>A tag library exercising SimpleTag handlers.</description>
<tlib-version>1.0</tlib-version>
<short-name>examples</short-name>
<uri>/demotag</uri>
<description>
A simple tab library for the examples
</description>
<tag>
<description>Outputs Hello, World,从实现Tag接口起开发</description>
<name>hello_int</name>
<tag-class>com.jspdev.ch6.HelloTag_Interface</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
我工程下的web.xml,如下声明:
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<!-- Copyright 2002 by ObjectLearn. All Rights Reserved. -->
<web-app 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-app_2_4.xsd"
version="2.4">
... ...
<taglib>
<taglib-uri>/demotag</taglib-uri>
<taglib-location>/WEB-INF/tlds/mytag.tld</taglib-location>
</taglib>
... ...
</web-app>
调用页面mytaglib.jsp
<%@ taglib uri="/demotag" prefix="hello"%>//这里报错:JSP Parsing Error:File "/demotag" not found
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<html>
<head>
<title>first cumstomed tag</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<p>以下的内容从Taglib中显示:</p>
<p><i><hello:hello_int/></i></p>
</body>
</html>
//本人采用eclipse2.1.2+lobmoz开发