在启用了Dynamic Web Module 3.0方面的Eclipse JEE项目中,我正在开发一个包含Java类,JSP和其他页面的webapp片段,然后将其部署在WAR中。在这个WAR web.xml
中,有以下内容:
<jsp-config>
<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
[same for other taglibs, JSTL core etc.]
</jsp-config>
这迫使我在JSP的开头部署:
<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
但是,我怎么告诉Eclipse考虑这个jsp配置?现在它只是在类路径中查找,找到standard.jar
和struts.jar
tld并看到<uri>
是错误的(对于struts-tiles,例如它{{1}而不是http://jakarta.apache.org/struts/tags-tiles
),然后是JSP解析器/tags/struts-tiles
。
如果我将Can not find the tag library descriptor for...
粘贴到我项目的web.xml
文件夹中,它似乎会被忽略。
答案 0 :(得分:0)
您是否考虑使用Web片段(部署描述符片段),它允许您编写web.xml配置的模块化“块”,然后在开发期间可以将容器组合在一起以形成整个应用程序。
要求:
1)每个片段必须位于 META-INF / web-fragment.xml文件中的自己的JAR中(通常位于构成应用程序的类中)。 (最多一个!)
2)必须将JAR文件部署到Web应用程序的/ WEB-INF / lib /目录。