0

struts.xml ファイルにグローバル例外処理を実装しようとしています。私の struts.xml ファイルは次のように設定されています。

<struts>
      <constant ..... />
           <include ......./>
</struts>

このファイルでグローバル例外マッピングとグローバル結果要素をどのようにネストすればよいですか?

4

1 に答える 1

1

S2のドキュメントでは、それが答えです:

<global-exception-mappings>
    <exception-mapping exception="org.apache.struts.register.exceptions.SecurityBreachException" result="securityerror" />
       <exception-mapping exception="java.lang.Exception" result="error" />
</global-exception-mappings>

<global-results>
        <result name="securityerror">/securityerror.jsp</result>
         <result name="error">/error.jsp</result>
</global-results>
于 2012-09-14T17:10:04.190 に答える