第一次使用标签,编译不通过,请进来帮一下吧.
我是完全按照书上的内容敲进去的.
ShowServer.jsp的内容.
<%@ taglib prefix="diag" uri="/WEB-INF/tlds/diagnostics.tld"%>
<html>
<head>
<title>Basic Example of a Custom Tag</title>
<body>
<h3>Basic Example of a Custom Tag</h3>
The web server is <diag:getWebServer/>
</body>
</head>
</html>
diagnostics.tld的内容.并且放在WEB-INF\tlds\下.
<?xml version="1.0" ?>
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>diag</shortname>
<tag>
<name>getWebServer</name>
<tagclass>jspcr.taglib.diag.GetWebServer</tagclass>
<bodycontent>empty</bodycontent>
</tag>
</taglib>
还有一个GetWebServerTag.java程序.编译后放到了WEB-INF\classes下.
执行时(TOMCAT/4.1.24-LE-jdk14)提示错误信息.
org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/tlds/diagnostics.tld: (line 2, col -1): 组件类型“taglib”未被声明。
at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:189)
1.那应该怎样声明taglib.
2.taglib和xml之间有什么联系.
3.哪里有taglib的电子书.
这里先谢谢各位了