public synchronized ActionForward invokeExceptionHandler ( Method method , Throwable ex , String message , ActionForm wrappedFormBean , PageFlowExceptionConfig exceptionConfig , ActionMapping actionMapping , HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { PerRequestState prevState = setPerRequestState ( new PerRequestState ( request , response , actionMapping ) ) ; try { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Invoking exception handler method " + method . getName ( ) + ' ' + method . getParameterTypes ( ) [ 0 ] . getName ( ) + ", ...)" ) ; } try { ActionForward retVal = null ; String actionName = InternalUtils . getActionName ( actionMapping ) ; if ( actionName == null && ex instanceof PageFlowException ) { actionName = ( ( PageFlowException ) ex ) . getActionName ( ) ; } try { Object formBean = InternalUtils . unwrapFormBean ( wrappedFormBean ) ; Object [ ] args = new Object [ ] { ex , actionName , message , formBean } ; retVal = ( ActionForward ) method . invoke ( this , args ) ; } finally { if ( ! exceptionConfig . isReadonly ( ) ) { ensureFailover ( request ) ; } } return retVal ; } catch ( InvocationTargetException e ) { Throwable target = e . getTargetException ( ) ; if ( target instanceof Exception ) { throw ( Exception ) target ; } else { throw e ; } } } catch ( Throwable e ) { _log . error ( "Exception while handling exception " + ex . getClass ( ) . getName ( ) + ". The original exception will be thrown." , e ) ; ExceptionsHandler eh = Handlers . get ( getServletContext ( ) ) . getExceptionsHandler ( ) ; FlowControllerHandlerContext context = new FlowControllerHandlerContext ( request , response , this ) ; Throwable unwrapped = eh . unwrapException ( context , e ) ; if ( ! eh . eatUnhandledException ( context , unwrapped ) ) { if ( ex instanceof ServletException ) throw ( ServletException ) ex ; if ( ex instanceof IOException ) throw ( IOException ) ex ; if ( ex instanceof Error ) throw ( Error ) ex ; throw new UnhandledException ( ex ) ; } return null ; } finally { setPerRequestState ( prevState ) ; } }
Invoke the given exception handler method . This is a framework - invoked method that should not normally be called directly