Struts 2.5 Intellij的分派器异常

时间:2018-11-03 19:31:44

标签: java web intellij-idea struts2

通过在Intellij(使用Intellij向导自动生成)中使用struts2.5创建项目,我遇到以下错误:

  

java.lang.ClassNotFoundException:org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

我还将Dispatcher更改为:

org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

但是出现了以下错误:

  

java.lang.ClassNotFoundException:org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

struts.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
    "http://struts.apache.org/dtds/struts-2.5.dtd">

<struts>
</struts>

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
     version="4.0">
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>
    <filter-mapping>
         <filter-name>struts2</filter-name>
         <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

index.jsp:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
   <head>
     <title>$Title$</title>
   </head>
   <body>
   $END$
   </body>
</html>

included Libs 我做错了什么?我不明白为什么Intellij不标记第二个调度程序类,但是启动后立即崩溃-谢谢

0 个答案:

没有答案