Execute post-request interceptors in a finally of their own

This commit is contained in:
Travis Burtrum 2019-01-08 15:13:07 -05:00
parent 55573244f3
commit c351d203d6

View File

@ -854,39 +854,37 @@ public class PageFlowRequestProcessor
}
finally
{
try {
//
// If this is not a forwarded request, then commit any session-scoped changes that were stored in the
// request.
//
if ( ! isForwardedRequest )
{
Handlers.get( getServletContext() ).getStorageHandler().applyChanges( requestContext );
if (!isForwardedRequest) {
Handlers.get(getServletContext()).getStorageHandler().applyChanges(requestContext);
}
//
// Callback to the server adapter.
//
_servletContainerAdapter.endRequest( request, response );
_servletContainerAdapter.endRequest(request, response);
long timeTaken = System.currentTimeMillis() - startTime;
er.endActionRequest( requestContext, timeTaken );
er.endActionRequest(requestContext, timeTaken);
} finally {
//
// Execute post-request interceptors
//
try
{
Interceptors.doPostIntercept( context, interceptors );
}
catch ( InterceptorException e )
{
try {
Interceptors.doPostIntercept(context, interceptors);
} catch (InterceptorException e) {
ServletUtils.throwServletException(e);
}
if ( LOG.isTraceEnabled() )
{
LOG.trace( "-------------------------------- End Request #" +
if (LOG.isTraceEnabled()) {
LOG.trace("-------------------------------- End Request #" +
localRequestCount +
" ------------------------------------" );
" ------------------------------------");
}
}
}
}