我創建了自己的taglib。我把TLD文件INT的src /主/資源/ META-IN/InputTagDescriptor.tld(使用maven項目)如何打包和使用自定義taglib(maven jar項目)
<?xml version="1.0" encoding="UTF-8"?>
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>input</shortname>
<info>provides an input tag with escaped value attribute</info>
<uri>http://blubber.com/</uri>
<tag>
<name>input</name>
<tagclass>com.vector.extranet.taglib.InputTagHandler</tagclass>
<info>Creates normal input tag but value will be escaped.</info>
<attribute>
<name>name</name>
<required>true</required>
</attribute>
<attribute>
<name>id</name>
<required>true</required>
</attribute>
<attribute>
<name>cssClass</name>
<required>false</required>
</attribute>
<attribute>
<name>maxlength</name>
<required>false</required>
</attribute>
<attribute>
<name>type</name>
<required>true</required>
</attribute>
<attribute>
<name>value</name>
<required>true</required>
</attribute>
</tag>
</taglib>
在我的web應用程序(Liferay的門戶,Maven化),包括我的taglib的依賴性的進口TLD在JSP:
<%@ taglib uri="http://blubber.com/InputTagDescriptor.tld" prefix="input" %>
戰爭打包,因爲它應該:WEB-INF \ lib中\ taglib.jar \ META-INF \ InputTagDescriptor.tld。 但在調用portlet中我得到:
12:56:53,486 ERROR [http-bio-8080-exec-12][render_portlet_jsp:157] org.apache.jasper.JasperException: The absolute uri:
http://blubber.com/InputTagDescriptor.tld cannot be resolved in either web.xml or the jar files deployed with this application
因此如何得到它的工作? (它不應該在web.xml幫助下工作嗎?)