openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsandt...@apache.org
Subject svn commit: r1676544 - /openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
Date Tue, 28 Apr 2015 14:25:40 GMT
Author: rsandtner
Date: Tue Apr 28 14:25:40 2015
New Revision: 1676544

URL: http://svn.apache.org/r1676544
Log:
OWB-1062 added lookup for JspRuntimeContext

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=1676544&r1=1676543&r2=1676544&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
Tue Apr 28 14:25:40 2015
@@ -128,17 +128,8 @@ public final class WebContainerLifecycle
         if(getWebBeansContext().getOpenWebBeansConfiguration().isJspApplication())
         {
             logger.log(Level.FINE, "Application is configured as JSP. Adding EL Resolver.");
-            
-            JspFactory factory = JspFactory.getDefaultFactory();
-            if (factory != null) 
-            {
-                JspApplicationContext applicationCtx = factory.getJspApplicationContext((ServletContext)(startupObject));
-                applicationCtx.addELResolver(resolver);                
-            }            
-            else
-            {
-                logger.log(Level.FINE, "Default JSPFactroy instance has not found");
-            }
+
+            setJspELFactory((ServletContext) startupObject, resolver);
         }
 
         // Add BeanManager to the 'javax.enterprise.inject.spi.BeanManager' servlet context
attribute
@@ -233,7 +224,36 @@ public final class WebContainerLifecycle
         
         throw new IllegalArgumentException("ServletContextEvent object but found null");
     }
-    
+
+    private void setJspELFactory(ServletContext startupObject, ELResolver resolver)
+    {
+        JspFactory factory = JspFactory.getDefaultFactory();
+        if (factory == null)
+        {
+            try
+            {
+                Class.forName("org.apache.jasper.compiler.JspRuntimeContext");
+                factory = JspFactory.getDefaultFactory();
+            }
+            catch (Exception e)
+            {
+                // ignore
+            }
+
+        }
+
+        if (factory != null)
+        {
+            JspApplicationContext applicationCtx = factory.getJspApplicationContext(startupObject);
+            applicationCtx.addELResolver(resolver);
+        }
+        else
+        {
+            logger.log(Level.FINE, "Default JSPFactroy instance has not found");
+        }
+    }
+
+
     /**
      * Conversation cleaner thread, that
      * clears unused conversations.



Mime
View raw message