Can't resolve URI of TagLib in .jar File
我正在尝试使用打包在Web应用程序jar中的taglib。
jar文件包含:
/WEB-INF/MyTagLib.tld,其中包含
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?xml version="1.0" encoding="UTF-8"?> <taglib> <tlibversion>1.0</tlibversion> <jspversion>1.1</jspversion> <shortname>MyTagLib</shortname> <info>My own TagLib</info> <uri>http://test.com/tags</uri> <tag> <name>mytag</name> <tagclass>com.test.tags.MyTag</tagclass> <info>My Tag</info> </tag> </taglib> |
/com/test/tags/MyTag.class
在我的Web项目中,我已将jar文件放在
我的jsp文件包含(除其他事项外):
1 2 | <%@ taglib uri="http://test.com/tags" prefix="MyTagLib" %> <MyTagLib:mytag> |
在Tomcat 6上部署后,页面将显示:
The absolute URI: http://test.com/tags cannot be resolved in either
web.xml or the jar files deployed with this application
我尝试将
File"/WEB-INF/MyTagLib.tld" not found
我在做什么错?
再一次,我在发布问题后立即发现了这个问题:
tld文件进入jar文件中的/ META-INF,然后可以正常工作。