I believe I'm actually decorating; this is a trimmed version of the code:

-------------------------------
In AppModule.java :

                @Match("RequestExceptionHandler")
                public static RequestExceptionHandler 
decorateRequestExceptionHandler(final Logger logger, final ResponseRenderer 
renderer,
                                                final ComponentSource 
componentSource, @Symbol(SymbolConstants.PRODUCTION_MODE) boolean 
productionMode, Object service)
                {
                                return new 
RequestExceptionHandlerImpl(componentSource);
                }

-------------------------------
In RequestExceptionHandlerImpl.java :

public class RequestExceptionHandlerImpl implements RequestExceptionHandler
{
                ....

                public RequestExceptionHandlerImpl(ComponentSource 
componentSource)
                {
                                this.componentSource = componentSource;
                }

                @Override
                public void handleRequestException(Throwable exception) throws 
IOException
                {
                                // Log the exception :
                                ....

                                // Redirect to previous page :

                                Component previousPage = 
getPreviousPage(request, this.componentEventLinkEncoder, this.componentSource);

                                Link redirectTo = 
this.pageRenderLinkSource.createPageRenderLink(previousPage.getClass());

                                response.sendRedirect(redirectTo);
                }
}
-------------------------------

Thanks for the info, that's what I was looking for.

Reply via email to