NETBEANS标签库问题,请教了
这是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>atmtag</short-name>
<uri>/WEB-INF/tlds/ATMtag</uri>
<!-- A validator verifies that the tags are used correctly at JSP
translation time. Validator entries look like this:
<validator>
<validator-class>com.mycompany.TagLibValidator</validator-class>
<init-param>
<param-name>parameter</param-name>
<param-value>value</param-value>
</init-param>
</validator>
-->
<!-- A tag library can register Servlet Context event listeners in
case it needs to react to such events. Listener entries look
like this:
<listener>
<listener-class>com.mycompany.TagLibListener</listener-class>
</listener>
-->
<tag>
<name>NewTagHandler</name>
<tag-class>NewTagHandler</tag-class>
<body-content>JSP</body-content>
</tag>
</taglib>
这是那个类:
这是调用JSP
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="ATMtag.tld" prefix="ATM"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>JSP Page</h1>
<ATM:NewTagHandler/>
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello ${param.name}!
</c:if>
--%>
</body>
</html>
这是运行结果
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 25 in the jsp file: /taglib.jsp
Generated servlet error:
C:\Documents and Settings\db2admin.ZV\.netbeans\4.1\jakarta-tomcat-5.5.7_base\work\Catalina\localhost\WebApplication2\org\apache\jsp\taglib_jsp.java:104: cannot resolve symbol
symbol : class NewTagHandler
location: class org.apache.jsp.taglib_jsp
NewTagHandler _jspx_th_ATM_NewTagHandler_0 = (NewTagHandler) _jspx_tagPool_ATM_NewTagHandler_nobody.get(NewTagHandler.class);
^
An error occurred at line: 25 in the jsp file: /taglib.jsp
Generated servlet error:
C:\Documents and Settings\db2admin.ZV\.netbeans\4.1\jakarta-tomcat-5.5.7_base\work\Catalina\localhost\WebApplication2\org\apache\jsp\taglib_jsp.java:104: cannot resolve symbol
symbol : class NewTagHandler
location: class org.apache.jsp.taglib_jsp
NewTagHandler _jspx_th_ATM_NewTagHandler_0 = (NewTagHandler) _jspx_tagPool_ATM_NewTagHandler_nobody.get(NewTagHandler.class);
^
An error occurred at line: 25 in the jsp file: /taglib.jsp
Generated servlet error:
C:\Documents and Settings\db2admin.ZV\.netbeans\4.1\jakarta-tomcat-5.5.7_base\work\Catalina\localhost\WebApplication2\org\apache\jsp\taglib_jsp.java:104: cannot resolve symbol
symbol : class NewTagHandler
location: class org.apache.jsp.taglib_jsp
NewTagHandler _jspx_th_ATM_NewTagHandler_0 = (NewTagHandler) _jspx_tagPool_ATM_NewTagHandler_nobody.get(NewTagHandler.class);
^
3 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:246)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.7 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.7
这是怎么回不啊这种问题怎么解决啊,我搞了好久搞不明白那位大哥可以帮帮我啊
问题点数:0、回复次数:0Top




