2013-02-07 164 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中使用它們:) –