openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1765963 - /openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
Date Fri, 21 Oct 2016 09:04:12 GMT
Author: rmannibucau
Date: Fri Oct 21 09:04:11 2016
New Revision: 1765963

URL: http://svn.apache.org/viewvc?rev=1765963&view=rev
Log:
small enhancement to avoid to require el api for web lifecycle

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=1765963&r1=1765962&r2=1765963&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 Oct 21 09:04:11 2016
@@ -29,7 +29,6 @@ import org.apache.webbeans.spi.ResourceI
 import org.apache.webbeans.spi.adaptor.ELAdaptor;
 import org.apache.webbeans.web.util.ServletCompatibilityUtil;
 
-import javax.el.ELResolver;
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.ConversationScoped;
 import javax.enterprise.context.RequestScoped;
@@ -103,14 +102,14 @@ public final class WebContainerLifecycle
     @Override
     protected void afterStartApplication(final Object startupObject)
     {
-        ELAdaptor elAdaptor = getWebBeansContext().getService(ELAdaptor.class);
-        ELResolver resolver = elAdaptor.getOwbELResolver();
         //Application is configured as JSP
         if(getWebBeansContext().getOpenWebBeansConfiguration().isJspApplication())
         {
+            ELAdaptor elAdaptor = getWebBeansContext().getService(ELAdaptor.class);
+
             logger.log(Level.FINE, "Application is configured as JSP. Adding EL Resolver.");
 
-            setJspELFactory((ServletContext) startupObject, resolver);
+            setJspELFactory((ServletContext) startupObject, elAdaptor.getOwbELResolver());
         }
 
         ServletContext servletContext =  null;
@@ -231,7 +230,7 @@ public final class WebContainerLifecycle
         throw new IllegalArgumentException("ServletContextEvent object but found null");
     }
 
-    protected void setJspELFactory(ServletContext startupObject, ELResolver resolver)
+    protected void setJspELFactory(ServletContext startupObject, Object resolver)
     {
         JspFactory factory = JspFactory.getDefaultFactory();
         if (factory == null)
@@ -258,7 +257,7 @@ public final class WebContainerLifecycle
         if (factory != null)
         {
             JspApplicationContext applicationCtx = factory.getJspApplicationContext(startupObject);
-            applicationCtx.addELResolver(resolver);
+            applicationCtx.addELResolver(javax.el.ELResolver.class.cast(resolver));
         }
         else
         {



Mime
View raw message