geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1245006 - /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/RequestListenerBeforeAfter.java
Date Thu, 16 Feb 2012 14:55:14 GMT
Author: xuhaihong
Date: Thu Feb 16 14:55:14 2012
New Revision: 1245006

URL: http://svn.apache.org/viewvc?rev=1245006&view=rev
Log:
Only invoke the request listener while entering the application and only invoking the listener
if the forwarding tag is set

Modified:
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/RequestListenerBeforeAfter.java

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/RequestListenerBeforeAfter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/RequestListenerBeforeAfter.java?rev=1245006&r1=1245005&r2=1245006&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/RequestListenerBeforeAfter.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/interceptor/RequestListenerBeforeAfter.java
Thu Feb 16 14:55:14 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.tomcat.interceptor;
 
+import javax.servlet.DispatcherType;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
@@ -34,12 +35,15 @@ public class RequestListenerBeforeAfter 
 
     public void before(BeforeAfterContext beforeAfterContext, ServletRequest httpRequest,
ServletResponse httpResponse, int dispatch) {
         if (httpRequest != null && httpResponse != null) {
-            standardContext.fireRequestInitEventInBeforeAfter(httpRequest);
+            DispatcherType dispatcherType = httpRequest.getDispatcherType();
+            if (dispatcherType == DispatcherType.REQUEST
+                    || (dispatcherType == DispatcherType.FORWARD && standardContext.getFireRequestListenersOnForwards()))
{
+                standardContext.fireRequestInitEventInBeforeAfter(httpRequest);
+            }
         }
         if (next != null) {
             next.before(beforeAfterContext, httpRequest, httpResponse, dispatch);
         }
-
     }
     
 



Mime
View raw message