谁能解释我为什么会出现以下异常:
java.lang.ClassCastException: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to com.evermind[Oracle Containers
for J2EE 10g (10.1.3.5.0) ].server.http.EvermindHttpServletRequest
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.NotFoundServlet.sendNotFound(NotFoundServlet.java:26
)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.NotFoundServlet.service(NotFoundServlet.java:18)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java
:64)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java
:15)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
当我假设有 NOT_FOUND 页面并且我的请求 url 以 .[some_ext] 结尾时,我得到了它,例如 .htm、.blah。但是当请求没有 .[some_ext] (如 _http:/domain/part1/part2/nosuchurl)时,一切正常,我在 struts 配置中映射了正常的 NOT_FOUND 页面:
<default-action-ref name="nopagefound"/>
<action name="nopagefound">
<result>/WEB-INF/jsp/errors/notfound.jsp</result>
</action>
我使用部署在 oc4j 10.1.3.5.0 上的 Struts2(2.3.1.2)+Spring。
这是我的struts映射:
<filter>
<filter-name>struts</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
而在 Struts.properties
struts.action.extension= ,