使用Maven时找不到切片的标记库描述符

Ken*_*ent 6 jsp struts2 apache-tiles maven

这是我在web.xml文件中的配置

<listener>
    <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>

<filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
Run Code Online (Sandbox Code Playgroud)

这是配置 pom.xml

    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-spring-plugin</artifactId>
        <version>2.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-jsp</artifactId>
        <version>2.2.2</version>
        <type>pom</type>
        <scope>compile</scope>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

它一直这样说:Can not find the tag library descriptor for "http://struts.apache.org/tags-tiles"当我将taglib添加到布局中时:

<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
Run Code Online (Sandbox Code Playgroud)

当我在服务器上运行时:

SEVERE: Error configuring application listener of class org.apache.struts2.tiles.StrutsTilesListener
Run Code Online (Sandbox Code Playgroud)

我在这里错过了什么吗?

Ken*_*ent 4

感谢Kenny Lee,我在几周后找到了这个问题的解决方案:((\nYou\xe2\x80\x99ll 需要通过以下方式配置你的 Eclipse 项目设置:

\n
    \n
  1. 在包资源管理器视图下的左侧面板上右键单击 Eclipse 中的项目。
  2. \n
  3. 单击“Java EE 模块依赖项”。
  4. \n
  5. 检查(确保选中该复选框)Maven 依赖项选项(最后一个选项)。
  6. \n
\n

对于 Eclipse 3.6,请单击此处了解更多信息

\n

有时配置后你必须刷新项目或使用mvn cleanmvn install会起作用

\n