首先我在我的WEB-INF的Classes目录下建了一个标签的执行类。TestTag。包名是mytag然后我在WEB-INF下建了一个TLD文件叫Test里面的配置是:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.1</jsp-version>
<tag>
<name>test</name>
<tagclass>mytag.TestTag</tagclass>
<body-content>empty</body-content>
</tag>
</taglib>
我在web.xml下面的配置是这样的
<taglib>
<taglib-uri>/test.tld</taglib-uri>
<taglib-location>/WEB-INF/test.tld</taglib-location>
</taglib>现在的问题是我在JSP页面下这样:<%@ taglib uri="/test.tld" prefix="mytag" %> 引入这标签库的时候。。MyEclipse总是提示我:Cannot find the tag library descriptor for test
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.1</jsp-version>
<tag>
<name>test</name>
<tagclass>mytag.TestTag</tagclass>
<body-content>empty</body-content>
</tag>
</taglib>
我在web.xml下面的配置是这样的
<taglib>
<taglib-uri>/test.tld</taglib-uri>
<taglib-location>/WEB-INF/test.tld</taglib-location>
</taglib>现在的问题是我在JSP页面下这样:<%@ taglib uri="/test.tld" prefix="mytag" %> 引入这标签库的时候。。MyEclipse总是提示我:Cannot find the tag library descriptor for test
解决方案 »
- apache的HttpClient4.x如何实现跨域访问
- 请教一个关于JSON 数据传输与接收的问题
- hibernate 插入乱码问题
- 如何在内存中保存一个list
- 关于struts标签中的bean:message,求一段代码
- 我在安装Eclipse3.1时,运行eclipse.exe时,出现“Required Java version:1.4.1.Available:1.3.1_01 ”错误,我装的是jdk1.5,请问为什么
- 提个很简单的问题,谢谢!
- 请教个关联显示的问题
- 怎样用jspSmartUpload实现word文件的下载
- 请问前端用jquery如何调用 java写的webservice接口。
- 三级联动菜单的视频有人要吗?
- select 的问题?
你看看是不是这个地方写错了:
<taglib>
<tlib-version>1.0 </tlib-version>
<jsp-version>1.1 </jsp-version>
<tag>
<name>test </name>
<tag-class>mytag.TestTag </tagclass>
<body-content>empty </body-content>
</tag>
</taglib>
<taglib>
<taglib-uri>/test.tld </taglib-uri>
<taglib-location>/WEB-INF/test.tld </taglib-location>
</taglib>
<taglib-location>/WEB-INF/classes/test.tld</taglib-location>
9/11/08 1:51:49 AM CST: [INFO] User settings file does not exist C:\Documents and Settings\三米\.m2\settings.xml
9/11/08 1:51:51 AM CST: Error on adding indexing context central; D:\java\Workspace\.metadata\.plugins\org.maven.ide.eclipse\nexus\central\_9.fdt (系统找不到指定的文件。)
9/11/08 1:51:52 AM CST: [INFO] User settings file does not exist C:\Documents and Settings\三米\.m2\settings.xml
<?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">
<description>My Taglib by Maodie</description>
<tlib-version>1.0</tlib-version>
<jsp-version>2.0</jsp-version>
<short-name>HelloTest</short-name>
<uri>/mytag</uri>
<small-icon></small-icon>
<tag>
<name>stringsplit</name>
<tag-class>com.helphand.util.StringSplitTag</tag-class>
<body-content>empty</body-content>
<attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>length</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>web.xml不要配置 若你的servlet容器版本不低的 话