+ -
当前位置:首页 → 问答吧 → 请教下struts2里action的异常处理问题

请教下struts2里action的异常处理问题

时间:2011-10-19

来源:互联网

在struts.xml中配置好异常。在action里不用try,catch,finally,那么产生异常的时候是怎么处理呢?是struts拦截到异常后根据异常类型在struts.xml里找处理方法么?那对于没在struts.xml里定义的异常呢?

struts新手,求教

作者: fyswords   发布时间: 2011-10-19

依然try catch

作者: lmx1989219   发布时间: 2011-10-19

貌似把异常类型设置成父类Exception就可以捕获所有异常了吧?
XML code
<exception-mapping result="exception" exception="Exception"></exception-mapping>

作者: fyswords   发布时间: 2011-10-19

热门下载

更多