myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r512374 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java
Date Tue, 27 Feb 2007 19:57:29 GMT
Author: bommel
Date: Tue Feb 27 11:57:28 2007
New Revision: 512374

URL: http://svn.apache.org/viewvc?view=rev&rev=512374
Log:
(TOBAGO-306) Allow valueReference in basename of tc:loadBundle like f:loadBundle

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java?view=diff&rev=512374&r1=512373&r2=512374
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java
Tue Feb 27 11:57:28 2007
@@ -23,6 +23,7 @@
 import org.apache.myfaces.tobago.util.BundleMapWrapper;
 
 import javax.faces.context.FacesContext;
+import javax.faces.webapp.UIComponentTag;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.TagSupport;
 import java.util.Map;
@@ -40,10 +41,17 @@
   private String var;
 
   public int doStartTag() throws JspException {
-    Map toStore = new BundleMapWrapper(basename);
+
+    String bundleBaseName;
+    FacesContext context = FacesContext.getCurrentInstance();
+    if (UIComponentTag.isValueReference(basename)) {
+      bundleBaseName = (String) context.getApplication().createValueBinding(basename).getValue(context);
+    } else {
+      bundleBaseName = basename;
+    }
+    Map toStore = new BundleMapWrapper(bundleBaseName);
     // TODO find a better way
-    FacesContext.getCurrentInstance().getExternalContext()
-        .getSessionMap().put(var, toStore);
+    context.getExternalContext().getSessionMap().put(var, toStore);
 //        .getRequestMap().put(var, toStore);
 
     return EVAL_BODY_INCLUDE;



Mime
View raw message