0
我想在struts.xml文件中實現全局異常處理。我的struts.xml文件是這樣設置的:java struts全局異常處理
<struts>
<constant ..... />
<include ......./>
</struts>
我應該如何在此文件中嵌套全局異常映射和全局結果元素?
我想在struts.xml文件中實現全局異常處理。我的struts.xml文件是這樣設置的:java struts全局異常處理
<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>
這是不是一個真正的問題,你有什麼問題? – Jaiwo99
按照[S2配置DTD](http://struts.apache.org/2.3.3/docs/strutsxml-examples.html)和每個例子。 –