小弟用SSI开发Demo工程,遇到全局异常不跳转的问题,各位大虾帮忙看看是神马问题:
struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
<!-- 公共配置信息 -->
<package name="common" extends="json-default">
<interceptors>
<interceptor name="authority" class="com.greenbird.bbs.common.interceptor.AuthorityInterceptor">
</interceptor>
<interceptor-stack name="myStack">
<interceptor-ref name="authority" />
<interceptor-ref name="timer"/>
<interceptor-ref name="params"/>
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="myStack" />
<!-- 全局跳转页面-->
<global-results>
<result name="RoleError">/pages/error/roleError.jsp</result>
<result name="Login">/index.jsp</result>
<result name="Error" type="redirect">/error.html</result>
</global-results>
<!-- 全局异常跳转 -->
<global-exception-mappings>
<exception-mapping result="Error" exception="com.greenbird.bbs.common.exception.BaseException"/>
<exception-mapping result="Error" exception="java.lang.Exception"/>
</global-exception-mappings>
</package>
<!-- ========== include struts XML ================================== -->
<include file="struts/*/*-config.xml" />
</struts>登录后,地址栏输入一个不存在的action请求路径,应该跳转到错误页面的,可是结果却是404,找不到页面,页面路径是对的这是什么问题
struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
<!-- 公共配置信息 -->
<package name="common" extends="json-default">
<interceptors>
<interceptor name="authority" class="com.greenbird.bbs.common.interceptor.AuthorityInterceptor">
</interceptor>
<interceptor-stack name="myStack">
<interceptor-ref name="authority" />
<interceptor-ref name="timer"/>
<interceptor-ref name="params"/>
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="myStack" />
<!-- 全局跳转页面-->
<global-results>
<result name="RoleError">/pages/error/roleError.jsp</result>
<result name="Login">/index.jsp</result>
<result name="Error" type="redirect">/error.html</result>
</global-results>
<!-- 全局异常跳转 -->
<global-exception-mappings>
<exception-mapping result="Error" exception="com.greenbird.bbs.common.exception.BaseException"/>
<exception-mapping result="Error" exception="java.lang.Exception"/>
</global-exception-mappings>
</package>
<!-- ========== include struts XML ================================== -->
<include file="struts/*/*-config.xml" />
</struts>登录后,地址栏输入一个不存在的action请求路径,应该跳转到错误页面的,可是结果却是404,找不到页面,页面路径是对的这是什么问题
配过了
<error-page>
<error-code>404</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>400</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.html</location>
</error-page>
http://www.ludou.org/why-custom-404-not-show-in-internet-explorer.html