I've been using a global-results mapping to chain exceptions to an exception
handler action:

<global-results>
      <result name="unhandledException" type="chain">error</result>
</global-results>

<global-exception-mappings>
  <exception-mapping exception="java.lang.Throwable"
result="unhandledException"/>
 </global-exception-mappings>

<action name="error" class="errorAction">
    <result name="success">/WEB-INF/jsp/error.jsp</result>
</action>

My errorAction has a setException(Exception ex) method on it expecting the
chain interceptor to set this value.  This has worked beautifully prior to
upgrading to struts 2.2.1.  I've traced the problem to the
ChainingInterceptor class now included in the struts2 code.  The piece
causing issues is the isChainResult(invocation) (this method was not present
in the xwork 2.1.6 version of the code):

private boolean isChainResult(ActionInvocation invocation) throws Exception
{
        Result result = invocation.getResult();
        return result != null &&
ActionChainResult.class.isAssignableFrom(result.getClass());
    }

The invocation is returning a null Result and therefore the method is
returning false which never allows the chaining interceptor to "do it's
thing."

Why is my Result null?  Has anyone else noticed any issues with the
ChainingInterceptor in struts 2.2.1?

Thanks,
Brice

Reply via email to