2013-02-07 172 views
0

我创建一个库 - customtags.jar缺少JAR资源包含TLD

enter image description here

taglib.tld结构如下

<?xml version="1.0" encoding="UTF-8"?> 
<taglib version="2.1" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"> 

<tlib-version>1.0</tlib-version> 
<short-name>custom</short-name> 
<uri>taglib</uri> 

<tag-file> 
    <name>label</name> 
    <path>/WEB-INF/tags/Label.tag</path> 
</tag-file> 
<tag-file> 
    <name>textarea</name> 
    <path>/WEB-INF/tags/TextArea.tag</path> 
</tag-file> 
<tag-file> 
    <name>textfield</name> 
    <path>/WEB-INF/tags/TextField.tag</path> 
</tag-file> 

在index.jsp页面

<%@taglib prefix="custom" uri="customtags.jar"%> 

enter image description here

如果我改变

<%@taglib prefix="custom" uri="WEB-INF/lib/customtags.jar"%> 

enter code here

请纠正和更新我!

+0

你的jar文件添加到类路径? –

+0

是的! @KevinBowersox –

+0

是的,你是否或解决了这个问题? –

回答

0

尝试直接在WEB-INF下创建tags目录,并将jar置于此目录中。

注意这个错误中提到了它正在寻找此目录中: enter image description here

+0

如何解决这个问题?但第一个错误是不同于此?你有任何解决方案的第一个错误:) –

+0

如何将我的标记文件合并到jar中,并在jsp中使用它们:) –