web.xml中引发StrutsPrepareAndExecuteFilter cannot be cast to javax.servlet.Filter异常

说明你用Meaven创建的WEB项目没有引入servlet-api
在你的pom.xml中加入

  <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>4.0.1</version>
      <scope>provided</scope>
    </dependency>

它就可以编译通过了
在这里插入图片描述

发布了109 篇原创文章 · 获赞 56 · 访问量 5694

猜你喜欢

转载自blog.csdn.net/zhang6132326/article/details/104806996