You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2016/02/13 00:41:41 UTC

svn commit: r1730144 - in /myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets: compiler/TextUnit.java el/ELText.java

Author: lu4242
Date: Fri Feb 12 23:41:41 2016
New Revision: 1730144

URL: http://svn.apache.org/viewvc?rev=1730144&view=rev
Log:
MYFACES-4031 Facelets does not render empty XHTML attribute

Modified:
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TextUnit.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/el/ELText.java

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TextUnit.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TextUnit.java?rev=1730144&r1=1730143&r2=1730144&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TextUnit.java (original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TextUnit.java Fri Feb 12 23:41:41 2016
@@ -310,7 +310,7 @@ final class TextUnit extends Compilation
                 String value = attrs[i].getValue();
                 this.buffer.append(' ').append(qname).append("=\"").append(value).append("\"");
 
-                ELText txt = ELText.parse(value);
+                ELText txt = ELText.parseAllowEmptyString(value);
                 if (txt != null)
                 {
                     if (txt.isLiteral())

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/el/ELText.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/el/ELText.java?rev=1730144&r1=1730143&r2=1730144&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/el/ELText.java (original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/el/ELText.java Fri Feb 12 23:41:41 2016
@@ -461,6 +461,18 @@ public class ELText
     {
         return parse(null, null, in);
     }
+    
+    public static ELText parseAllowEmptyString(String in) throws ELException
+    {
+        if (in != null && in.length() == 0)
+        {
+            return new ELText(in);
+        }
+        else
+        {
+            return parse(null, null, in);
+        }
+    }
 
     /**
      * Factory method for creating a validated ELText instance. When an Expression is hit, it will use the