1. In struts.xml, use global-exception-mappings to define mappings that
catch-all exceptions of interest.
<global-exception-mappings>
<exception-mapping exception="java.lang.NoSuchMethodException"
result="methodNotSupported"/>
<exception-mapping exception="java.lang.IllegalArgumentException"
result="methodNotSupported"/>
<exception-mapping exception="java.lang.Throwable" result="error"/>
</global-exception-mappings>
2. In struts.xml, define global-results that are referenced by the
global-exception-mappings. These are standard struts2 results that can
render your error page.
Here's an example:
<global-results>
<result name="methodNotSupported" type="httpheader">
<param name="error">405</param>
<param name="errorMessage">The requested method is
unsupported</param>
</result>
<result name="error" type="redirect">/error.jsp</result>
</global-results>
3. The interceptor cannot catch exceptions that occur outside the action
invocation. As you've already discovered, you have to use the
container's error handling for these.
If you're using Apache in front of tomcat you'll also need to repeat the
information a third time there (eg. error page if tomcat is down).