简体   繁体   中英

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

sorry I posted this question as there were many duplicates of the same issue.But the answer did'nt seem to help me.The error that i obtain is shown below

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

In the web.xml file I have added

<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 file

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

I have added the struts2-core-2.2.1.jar file into the lib directory under WEB_INF Folder.Could someone help me on how to solve this issue.

Since Struts 2.1.3, the FilterDispatcher is deprecated:

Deprecated. Since Struts 2.1.3, use StrutsPrepareAndExecuteFilter instead or StrutsPrepareFilter and StrutsExecuteFilter if needing using the ActionContextCleanUp filter in addition to this one

Also consider migrating to the latest version of Struts2 (currently, 2.3.16.3), to avoid security issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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