繁体   English   中英

异常处理ErrorPage。找不到Struts调度程序.org.apache.jasper.JasperException:找不到Struts调度程序

[英]Exception Processing ErrorPage .The Struts dispatcher cannot be found.org.apache.jasper.JasperException: The Struts dispatcher cannot be found

抱歉,我发布了此问题,因为同一问题有很多重复项。但是答案似乎并没有帮助我。我获得的错误如下所示

org.apache.catalina.core.StandardHostValve custom
SEVERE: Exception Processing ErrorPage[errorCode=404, location=/WEB-INF/error/error.jsp]
org.apache.jasper.JasperException: The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag

在web.xml文件中,我添加了

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

    <filter-mapping>  
        <filter-name>struts2</filter-name>  
        <url-pattern>/*</url-pattern>  
    </filter-mapping> 

struts.xml文件

<action name="home">
            <result name="success" >/WEB-INF/index.jsp</result>
            <result name="error" >/WEB-INF/error/error.jsp</result>
</action>

我已将struts2-core-2.2.1.jar文件添加到WEB_INF文件夹下的lib目录中。有人可以帮助我解决该问题。

从Struts 2.1.3开始,不推荐使用FilterDispatcher

不推荐使用。 从Struts 2.1.3开始,请改用StrutsPrepareAndExecuteFilterStrutsPrepareFilterStrutsExecuteFilter(如果需要使用ActionContextCleanUp过滤器)

还可以考虑迁移到最新版本的Struts2(当前为2.3.16.3),以避免安全问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM