openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r937347 - /openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
Date Fri, 23 Apr 2010 15:50:38 GMT
Author: gerdogdu
Date: Fri Apr 23 15:50:37 2010
New Revision: 937347

URL: http://svn.apache.org/viewvc?rev=937347&view=rev
Log:
[OWB-360] Add BeanManager to a ServletContext attribute, thanks to Christian Kaltepoth(given
patch is updated before applying)

Modified:
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java?rev=937347&r1=937346&r2=937347&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
Fri Apr 23 15:50:37 2010
@@ -22,6 +22,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+import javax.enterprise.inject.spi.BeanManager;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.jsp.JspApplicationContext;
@@ -101,9 +102,15 @@ public final class WebContainerLifecycle
         {
             logger.debug("Application is configured as JSP. Adding EL Resolver.");
             
-            JspApplicationContext applicationCtx = JspFactory.getDefaultFactory().getJspApplicationContext((ServletContext)startupObject);
+            JspApplicationContext applicationCtx = JspFactory.getDefaultFactory().getJspApplicationContext((ServletContext)(startupObject));
             applicationCtx.addELResolver(new WebBeansELResolver());  
-        }        
+        }      
+        
+        
+        // Add BeanManager to the 'javax.enterprise.inject.spi.BeanManager' servlet context
attribute
+        ServletContext servletContext = (ServletContext)(startupObject); 
+        servletContext.setAttribute(BeanManager.class.getName(), getBeanManager());
+        
     }
     
     protected void beforeStartApplication(Object startupObject)



Mime
View raw message