geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r374885 - in /geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat: interceptor/PolicyContextBeforeAfter.java realm/TomcatGeronimoRealm.java
Date Sat, 04 Feb 2006 16:10:50 GMT
Author: jgenender
Date: Sat Feb  4 08:10:47 2006
New Revision: 374885

URL: http://svn.apache.org/viewcvs?rev=374885&view=rev
Log:
Save the Request during x-context dispatch

Modified:
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/interceptor/PolicyContextBeforeAfter.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/realm/TomcatGeronimoRealm.java

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/interceptor/PolicyContextBeforeAfter.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/interceptor/PolicyContextBeforeAfter.java?rev=374885&r1=374884&r2=374885&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/interceptor/PolicyContextBeforeAfter.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/interceptor/PolicyContextBeforeAfter.java
Sat Feb  4 08:10:47 2006
@@ -22,6 +22,7 @@
 import javax.servlet.ServletResponse;
 
 import org.apache.catalina.connector.Request;
+import org.apache.geronimo.tomcat.realm.TomcatGeronimoRealm;
 
 public class PolicyContextBeforeAfter implements BeforeAfter{
     
@@ -40,7 +41,10 @@
         //Save the old
         PolicyObject policyObject = new PolicyObject();
         policyObject.setContextId(PolicyContext.getContextID());
-        //policyObject.setRequest(TomcatGeronimoRealm.setRequest(httpRequest));
+        //Save the old Request object in case it gets changed 
+        //with a x-context Dispatch
+        policyObject.setRequest(TomcatGeronimoRealm.getRequest());
+        
         context[policyContextIDIndex] = policyObject;
         
         //Set the new
@@ -61,7 +65,7 @@
         PolicyObject policyObject = (PolicyObject)context[policyContextIDIndex];
         
         PolicyContext.setContextID(policyObject.getContextId());
-        //TomcatGeronimoRealm.setRequest(policyObject.getRequest());
+        TomcatGeronimoRealm.setRequest(policyObject.getRequest());
     }
     
     class PolicyObject{

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/realm/TomcatGeronimoRealm.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/realm/TomcatGeronimoRealm.java?rev=374885&r1=374884&r2=374885&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/realm/TomcatGeronimoRealm.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/realm/TomcatGeronimoRealm.java
Sat Feb  4 08:10:47 2006
@@ -73,11 +73,15 @@
 
      }
 
-//    public static ServletRequest setRequest(Request request) {
-//        ServletRequest old = (ServletRequest) currentRequest.get();
-//        currentRequest.set(request);
-//        return old;
-//    }
+    public static Request getRequest() {
+        return (Request) currentRequest.get();
+    }
+    
+    public static Request setRequest(Request request) {
+        Request old = (Request) currentRequest.get();
+        currentRequest.set(request);
+        return old;
+    }
 
     /**
      * Enforce any user data constraint required by the security constraint



Mime
View raw message