struts.xml ファイルにグローバル例外処理を実装しようとしています。私の struts.xml ファイルは次のように設定されています。
<struts>
<constant ..... />
<include ......./>
</struts>
このファイルでグローバル例外マッピングとグローバル結果要素をどのようにネストすればよいですか?
struts.xml ファイルにグローバル例外処理を実装しようとしています。私の struts.xml ファイルは次のように設定されています。
<struts>
<constant ..... />
<include ......./>
</struts>
このファイルでグローバル例外マッピングとグローバル結果要素をどのようにネストすればよいですか?
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>