You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2005/10/31 02:19:21 UTC

svn commit: r329692 - /myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/scope/ScopeUtils.java

Author: mmarinschek
Date: Sun Oct 30 17:19:16 2005
New Revision: 329692

URL: http://svn.apache.org/viewcvs?rev=329692&view=rev
Log:
handle /faces/* mapping without recursion problems.

Modified:
    myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/scope/ScopeUtils.java

Modified: myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/scope/ScopeUtils.java
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/scope/ScopeUtils.java?rev=329692&r1=329691&r2=329692&view=diff
==============================================================================
--- myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/scope/ScopeUtils.java (original)
+++ myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/scope/ScopeUtils.java Sun Oct 30 17:19:16 2005
@@ -15,7 +15,13 @@
  */
 package org.apache.myfaces.custom.scope;
 
+import org.apache.commons.logging.impl.AvalonLogger;
+import org.apache.commons.logging.impl.Log4JCategoryLog;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
 
 /**
  * Small helper to cope with the
@@ -35,6 +41,7 @@
 {
     private static final String EL_END = "}";
     private static final String EL_BEGIN = "#{";
+    private static Log log = LogFactory.getLog(ScopeUtils.class);
 
     /**
      * el checker
@@ -60,9 +67,19 @@
                     .createValueBinding(beanName).getValue(
                             FacesContext.getCurrentInstance());
         else
-            return FacesContext.getCurrentInstance().getApplication()
+        {
+            try
+            {
+                return FacesContext.getCurrentInstance().getApplication()
                     .createValueBinding(EL_BEGIN + beanName + EL_END).getValue(
                             FacesContext.getCurrentInstance());
+            }
+            catch(Exception ex)
+            {
+                log.error("ScopeContainer not found - has not been initialized.",ex);
+                return null;
+            }
+        }
     }
 
 }