myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bara...@apache.org
Subject svn commit: r368938 - /myfaces/sandbox/trunk/sandbox/src/main/java/org/apache/myfaces/custom/scope/ScopeUtils.java
Date Sat, 14 Jan 2006 00:42:56 GMT
Author: baranda
Date: Fri Jan 13 16:42:52 2006
New Revision: 368938

URL: http://svn.apache.org/viewcvs?rev=368938&view=rev
Log:
Fixed some issues noticed by Dennis Byrne

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

Modified: myfaces/sandbox/trunk/sandbox/src/main/java/org/apache/myfaces/custom/scope/ScopeUtils.java
URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/sandbox/src/main/java/org/apache/myfaces/custom/scope/ScopeUtils.java?rev=368938&r1=368937&r2=368938&view=diff
==============================================================================
--- myfaces/sandbox/trunk/sandbox/src/main/java/org/apache/myfaces/custom/scope/ScopeUtils.java
(original)
+++ myfaces/sandbox/trunk/sandbox/src/main/java/org/apache/myfaces/custom/scope/ScopeUtils.java
Fri Jan 13 16:42:52 2006
@@ -49,7 +49,7 @@
     public static final boolean isEl(String beanName)
     {
         beanName = beanName.trim();
-        return beanName.startsWith("EL_BEGIN") && !beanName.endsWith(EL_END);
+        return beanName.startsWith(EL_BEGIN) && beanName.endsWith(EL_END);
     }
 
     /**
@@ -60,13 +60,21 @@
     public static Object getManagedBean(String beanName)
     {
         if (isEl(beanName))
+        {
+            if(FacesContext.getCurrentInstance() == null)
+                return null;
+        
             return FacesContext.getCurrentInstance().getApplication()
                     .createValueBinding(beanName).getValue(
                             FacesContext.getCurrentInstance());
+        }
         else
         {
             try
             {
+                if(FacesContext.getCurrentInstance() == null)
+                    return null;
+                
                 return FacesContext.getCurrentInstance().getApplication()
                     .createValueBinding(EL_BEGIN + beanName + EL_END).getValue(
                             FacesContext.getCurrentInstance());



Mime
View raw message