我创建了自己的标签库。我把 tld 文件 int src/main/resources/META-IN/InputTagDescriptor.tld (使用 maven 项目)
<?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>
在我的 webapp(liferay portlet,mavenized)中,我包含了 taglib 的依赖项,并在 jsp 中导入了 tld:
<%@ 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 帮助的情况下工作,不是吗?)