[seam-commits] Seam SVN: r10573 - branches/community/Seam_2_1/src/main/org/jboss/seam/contexts.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Apr 22 02:23:35 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-04-22 02:23:34 -0400 (Wed, 22 Apr 2009)
New Revision: 10573

Modified:
   branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/Lifecycle.java
   branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/ServletLifecycle.java
Log:
JBSEAM-2523, Stuart Douglas's patch

Modified: branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/Lifecycle.java
===================================================================
--- branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/Lifecycle.java	2009-04-22 05:28:41 UTC (rev 10572)
+++ branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/Lifecycle.java	2009-04-22 06:23:34 UTC (rev 10573)
@@ -8,12 +8,14 @@
 
 import java.util.Map;
 import java.util.Set;
+import javax.servlet.ServletContext;
 
 import org.jboss.seam.ScopeType;
 import org.jboss.seam.core.ConversationEntries;
 import org.jboss.seam.core.Manager;
 import org.jboss.seam.log.LogProvider;
 import org.jboss.seam.log.Logging;
+import org.jboss.seam.servlet.ServletApplicationMap;
 
 /**
  * Methods for setup and teardown of Seam contexts.
@@ -175,7 +177,7 @@
       Contexts.destroyConversationContext(session, conversationId);
    }
 
-   public static void beginSession(Map<String, Object> session)
+   public static void beginSession(Map<String, Object> session, ServletContext appCtx)
    {
       log.debug("Session started");
       
@@ -187,8 +189,17 @@
       boolean conversationContextActive = Contexts.isConversationContextActive();
 
       if ( !applicationContextActive )
-      {
-         Context tempApplicationContext = new ApplicationContext( getApplication() );
+      {         
+         Context tempApplicationContext = null;
+         if(appCtx == null)
+         {
+            tempApplicationContext = new ApplicationContext( getApplication() );
+         }
+         else
+         {
+            tempApplicationContext = new ApplicationContext( new ServletApplicationMap(appCtx) );
+         }                  
+         
          Contexts.applicationContext.set(tempApplicationContext);
       }
       Context oldSessionContext = Contexts.sessionContext.get();

Modified: branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/ServletLifecycle.java
===================================================================
--- branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/ServletLifecycle.java	2009-04-22 05:28:41 UTC (rev 10572)
+++ branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/ServletLifecycle.java	2009-04-22 06:23:34 UTC (rev 10573)
@@ -144,7 +144,7 @@
 
    public static void beginSession(HttpSession session)
    {
-      Lifecycle.beginSession( new ServletSessionMap(session) );
+      Lifecycle.beginSession( new ServletSessionMap(session), session.getServletContext() );
    }
 
    public static void endSession(HttpSession session)




More information about the seam-commits mailing list