Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49991
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 19 Oct 2010 20:27:39 +0000 (20:27 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 19 Oct 2010 20:27:39 +0000 (20:27 +0000)
Ensure servlet request listeners are fired for the login and error pages during FORM authentication.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1024397 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/authenticator/FormAuthenticator.java
webapps/docs/changelog.xml

index 8e14b22..f8ed35c 100644 (file)
@@ -327,7 +327,10 @@ public class FormAuthenticator
             context.getServletContext().getRequestDispatcher
             (config.getLoginPage());
         try {
-            disp.forward(request.getRequest(), response);
+            if (context.fireRequestInitEvent(request)) {
+                disp.forward(request.getRequest(), response);
+                context.fireRequestDestroyEvent(request);
+            }
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             String msg = sm.getString("formAuthenticator.forwardLoginFail");
@@ -357,7 +360,10 @@ public class FormAuthenticator
             context.getServletContext().getRequestDispatcher
             (config.getErrorPage());
         try {
-            disp.forward(request.getRequest(), response);
+            if (context.fireRequestInitEvent(request)) {
+                disp.forward(request.getRequest(), response);
+                context.fireRequestDestroyEvent(request);
+            }
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             String msg = sm.getString("formAuthenticator.forwardErrorFail");
index 4c5cf30..175c0db 100644 (file)
   <subsection name="Catalina">
     <changelog>
       <fix>
+        <bug>49991</bug>: Ensure servlet request listeners are fired for
+        the login and error pages during FORM authentication. (markt)
+      </fix>
+      <fix>
         <bug>50107</bug>: When removing a Host via JMX, do not attempt to
         destroy the host&apos;s pipeline twice. Patch provided by Eiji
         Takahashi. (markt)