我们知道在struts.xml中增加global-exceptions配置可以将未捕捉的异常指向一个result,且该result可显示一个jsp页面,在jsp页面中用等可以显示该异常消息。
但是因为我希望在显示异常前做一些额外处理,比如发送Email通知维护人员。所以我将result redirect到一个Action中,但是如何在该Action中获得捕捉到的异常?
我使用了:
1. ActionContext.getContext().getValueStack().findValue("exception");
2. ActionContext.getContext().getParameters.get("exception");
3. ActionContext.getContext().get.....
等等方法都无法获得该Exception.
请教大家了~~