簡體   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