谢谢,这确实是struts2.3.20的Bug https://issues.apache.org/jira/browse/WW-4433 里面还提供了一个解决方案 We've created our own UnknownHandler implementation that just throws a new NoSuchMethodException, allowing DefaultActionInvocation to re-throw the original exception so that our error interceptor can again catch it.他上面这个我不知道怎么用,因为时间问题就不去研究了,如果用spring aop管理异常,则能忽视这Bug 如果想用struts2管理异常,则应该要用上面英文的方法,或等到2.3.22及以上的版,或用回2.3.16.3及以下的版
admin = null;
admin.getAccount().toString();
这一步肯定会报空指针异常,不会再走下去
里面还提供了一个解决方案
We've created our own UnknownHandler implementation that just throws a new NoSuchMethodException, allowing DefaultActionInvocation to re-throw the original exception so that our error interceptor can again catch it.他上面这个我不知道怎么用,因为时间问题就不去研究了,如果用spring aop管理异常,则能忽视这Bug
如果想用struts2管理异常,则应该要用上面英文的方法,或等到2.3.22及以上的版,或用回2.3.16.3及以下的版