incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwald...@apache.org
Subject svn commit: r527344 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java
Date Wed, 11 Apr 2007 00:09:26 GMT
Author: jwaldman
Date: Tue Apr 10 17:09:25 2007
New Revision: 527344

URL: http://svn.apache.org/viewvc?view=rev&rev=527344
Log:
ADFFACES-432 XMLMenuModel does not correctly parse Resource Bundle EL expressions for menu
item labels.
Check in for Gary Kind

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java?view=diff&rev=527344&r1=527343&r2=527344
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java
Tue Apr 10 17:09:25 2007
@@ -740,27 +740,10 @@
    */
   private String _evalElStr(String str)
   {
-    // Check to see if EL expression gets its value from a
-    // resource bundle.      
-    String elVar = str.substring(2, str.indexOf('.'));
-    
-    if (   _bundleKey != null
-        && _bundleKey.equals(elVar)
-       )
-    {
-      // we have an EL expression to get a value from a 
-      // resource bundle
-      elVar = str.substring(0, str.indexOf('.'));
-      String elKey = str.substring(str.indexOf('.'));
-      String elStr = elVar + getHandlerId() + elKey;
-      String elVal = (String)MenuUtils.getBoundValue(elStr);
-      return elVal;       
-    }
-    else
-    {
-      // We have some other EL expression
-      return (String)MenuUtils.getBoundValue(str);
-    }
+   String keystr = 
+     str.trim().replaceFirst(_bundleKey, _bundleKey + getHandlerId());
+   String elVal = (String) MenuUtils.getBoundValue(keystr);
+   return elVal;       
   }
   
   private String         _label       = null;



Mime
View raw message