geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r807218 - /geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/listener/DispatchListener.java
Date Mon, 24 Aug 2009 13:50:56 GMT
Author: xuhaihong
Date: Mon Aug 24 13:50:56 2009
New Revision: 807218

URL: http://svn.apache.org/viewvc?rev=807218&view=rev
Log:
GERONIMO-4811 The new PolicyContext is not set while forwarding to another web application

Modified:
    geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/listener/DispatchListener.java

Modified: geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/listener/DispatchListener.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/listener/DispatchListener.java?rev=807218&r1=807217&r2=807218&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/listener/DispatchListener.java
(original)
+++ geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/listener/DispatchListener.java
Mon Aug 24 13:50:56 2009
@@ -18,6 +18,7 @@
 
 import java.util.Stack;
 
+import javax.security.jacc.PolicyContext;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
@@ -45,6 +46,7 @@
         }
     };
 
+
     public void instanceEvent(InstanceEvent event) {
 
         if (event.getType().equals(InstanceEvent.BEFORE_DISPATCH_EVENT)) {
@@ -67,10 +69,13 @@
         BeforeAfter beforeAfter = webContext.getBeforeAfter();
         if (beforeAfter != null) {
             Stack<Object[]> stack = currentContext.get();
-            Object context[] = new Object[webContext.getContextCount() + 1];
+            Object context[] = new Object[webContext.getContextCount() + 2];
             String wrapperName = getWrapperName(request, webContext);
             context[webContext.getContextCount()] = JACCRealm.setRequestWrapperName(wrapperName);
-
+            
+            context[webContext.getContextCount() + 1] = PolicyContext.getContextID();
+            PolicyContext.setContextID(webContext.getPolicyContextId());
+            
             beforeAfter.before(context, request, response, BeforeAfter.DISPATCHED);
 
             stack.push(context);
@@ -87,6 +92,7 @@
             beforeAfter.after(context, request, response, BeforeAfter.DISPATCHED);
 
             JACCRealm.setRequestWrapperName((String) context[webContext.getContextCount()]);
+            PolicyContext.setContextID((String) context[webContext.getContextCount()] + 1);
         }
     }
 



Mime
View raw message