我正在尝试在一个struts.xml文件中实现全局异常处理。我的struts.xml文件设置如下:
<struts>
<constant ..... />
<include ......./>
</struts>我应该如何在这个文件中嵌套全局异常映射和全局结果元素?
发布于 2012-09-15 01:10:04
在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>https://stackoverflow.com/questions/12428341
复制相似问题