Author: markt Date: Mon Mar 6 22:14:05 2017 New Revision: 1785774 URL: http://svn.apache.org/viewvc?rev=1785774&view=rev Log: Ensure request and response facades are used when firing application listeners.
Modified: tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java?rev=1785774&r1=1785773&r2=1785774&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java (original) +++ tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java Mon Mar 6 22:14:05 2017 @@ -427,9 +427,9 @@ public class FormAuthenticator RequestDispatcher disp = context.getServletContext().getRequestDispatcher(loginPage); try { - if (context.fireRequestInitEvent(request)) { + if (context.fireRequestInitEvent(request.getRequest())) { disp.forward(request.getRequest(), response); - context.fireRequestDestroyEvent(request); + context.fireRequestDestroyEvent(request.getRequest()); } } catch (Throwable t) { ExceptionUtils.handleThrowable(t); @@ -471,12 +471,11 @@ public class FormAuthenticator } RequestDispatcher disp = - context.getServletContext().getRequestDispatcher - (config.getErrorPage()); + context.getServletContext().getRequestDispatcher(config.getErrorPage()); try { - if (context.fireRequestInitEvent(request)) { + if (context.fireRequestInitEvent(request.getRequest())) { disp.forward(request.getRequest(), response); - context.fireRequestDestroyEvent(request); + context.fireRequestDestroyEvent(request.getRequest()); } } catch (Throwable t) { ExceptionUtils.handleThrowable(t); Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1785774&r1=1785773&r2=1785774&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Mon Mar 6 22:14:05 2017 @@ -112,7 +112,7 @@ public class AsyncContextImpl implements } } } finally { - context.fireRequestDestroyEvent(request); + context.fireRequestDestroyEvent(request.getRequest()); clearServletRequestResponse(); context.unbind(Globals.IS_SECURITY_ENABLED, oldCL); } Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java?rev=1785774&r1=1785773&r2=1785774&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Mon Mar 6 22:14:05 2017 @@ -123,7 +123,7 @@ final class StandardHostValve extends Va try { context.bind(Globals.IS_SECURITY_ENABLED, MY_CLASSLOADER); - if (!asyncAtStart && !context.fireRequestInitEvent(request)) { + if (!asyncAtStart && !context.fireRequestInitEvent(request.getRequest())) { // Don't fire listeners during async processing (the listener // fired for the request that called startAsync()). // If a request init listener throws an exception, the request @@ -179,7 +179,7 @@ final class StandardHostValve extends Va } if (!request.isAsync() && !asyncAtStart) { - context.fireRequestDestroyEvent(request); + context.fireRequestDestroyEvent(request.getRequest()); } } finally { // Access a session (if present) to update last accessed time, based Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1785774&r1=1785773&r2=1785774&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Mon Mar 6 22:14:05 2017 @@ -167,6 +167,10 @@ session - if there is a session - when running under a <code>SecurityManager</code>. Patch provided by Jan Engehausen. (markt) </fix> + <fix> + Ensure request and response facades are used when firing application + listeners. (markt/remm) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org