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目录中。有人可以帮我解决这个问题。
答案 0 :(得分:0)
自Struts 2.1.3起,FilterDispatcher已被弃用:
已过时。自Struts 2.1.3起,使用StrutsPrepareAndExecuteFilter 相反,如果需要,可以StrutsPrepareFilter和StrutsExecuteFilter 除此之外还使用ActionContextCleanUp过滤器
另请考虑迁移到最新版本的Struts2(目前为2.3.16.3),以避免出现安全问题。