无法在web.xml或jar文件中解析Struts tags-tiles

时间:2015-03-15 14:16:36

标签: java jsp maven struts2 tiles

我在Eclipse IDE和JBoss5服务器和maven中使用Struts2进行构建。我试图在简单的登录应用程序中使用磁贴。但我无法包含taglib。我在pom.xml文件中导入了所有必需的jar依赖项。以下是我在maven pom.xml文件中包含的jar列表:

  • struts2-core 2.3.15.1
  • struts2-tiles-plugin 2.3.15.1
  • 公地BeanUtils的
  • 支柱-标签库
  • 公地消化器
  • 公地BeanUtils的
  • 瓦片-API

我还包括并尝试了

的不同组合
  1. tiles-api-2.0.3.jar
  2. tiles-core-2.0.3.jar
  3. 瓦片-JSP-2.0.3.jar
  4. 支柱-tiles.jar
  5. 仍然没有用,错误是:

    -The absolute uri: http://tiles.apache.org/tags-tiles cannot be resolved in either web.xml or the jar files deployed with this application
    -ServletException including path '/layout.jsp'. 
    -ServletException including path '/layout.jsp'. 
    

    当我尝试在JSP页面上导入tile taglib时,它说

      

    URI:http://tiles.apache.org/tags-tiles无法解析   web.xml或使用此应用程序部署的jar文件。

    我也试过谷歌。得到了一些解决方案,但它们对我没有用。

2 个答案:

答案 0 :(得分:1)

您应该至少使用版本2.4的servlet API。在tile中你可以使用taglib定义

<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

不要搞乱Struts 1 taglib和使用Tiles工件的瓷砖罐。

答案 1 :(得分:1)

相关问题