我正在使用Struts2,我遇到了一個與它的錯誤處理機制有關的問題。 我想這樣做是讓堆棧跟蹤和例外,以便用它的動作類裏 屬性(如對 控制檯打印)或JSP頁面內(不使用標籤庫)。Struts 2錯誤處理 - 如何獲取堆棧跟蹤和異常屬性?
婁還有就是我的struts.xml文件的一個片段:
<default-interceptor-ref name="defaultStack"/>
<global-results>
<result name="Exception" type="redirect">/error.action</result>
</global-results>
<global-exception-mappings>
<exception-mapping result="Exception" exception="java.lang.Exception" />
</global-exception-mappings>
<action name="error" class="fend.ErrorAction">
<result>/error.jsp</result>
<interceptor-ref name="configStack"/>
</action>
提前感謝!