配置全局的异常页面

配置全局的错误页面1.web.xml中!-- error页面-- error-pageerror-code404/error-codelocation/e

配置全局的错误页面

1.web.xml中
<!-- error页面-->
 <error-page>
  <error-code>404</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>500</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>503</error-code>
  <location>/error.jsp</location>
 </error-page>
2.struts.xml中
        <global-results>
            <result name="error">/error.jsp</result>
        </global-results>

        <global-exception-mappings>
            <exception-mapping exception="java.lang.Exception" result="error"/>
        </global-exception-mappings>