myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1178544 - /myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java
Date Mon, 03 Oct 2011 19:52:55 GMT
Author: lu4242
Date: Mon Oct  3 19:52:55 2011
New Revision: 1178544

URL: http://svn.apache.org/viewvc?rev=1178544&view=rev
Log:
MYFACES-3343 f:convertNumber in jsp only accept Locale instance into its locale attribute

Modified:
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java?rev=1178544&r1=1178543&r2=1178544&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java
(original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java
Mon Oct  3 19:52:55 2011
@@ -19,6 +19,7 @@
 package org.apache.myfaces.taglib.core;
 
 import org.apache.myfaces.shared.taglib.UIComponentELTagUtils;
+import org.apache.myfaces.shared.util.LocaleUtils;
 
 import javax.el.ELContext;
 import javax.el.ValueExpression;
@@ -150,11 +151,19 @@ public class ConvertNumberTag extends Co
             Locale locale;
             if (_locale.isLiteralText())
             {
-                locale = new Locale(_locale.getExpressionString());
+                locale = LocaleUtils.toLocale(_locale.getExpressionString());
             }
             else
             {
-                locale = (Locale)_locale.getValue(elContext);
+                Object localeValue = _locale.getValue(elContext);
+                if (localeValue instanceof Locale)
+                {
+                    locale = (Locale)localeValue;
+                }
+                else
+                {
+                    locale = LocaleUtils.toLocale(localeValue.toString());
+                }
                 if (null == locale)
                 {
                     locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();



Mime
View raw message