Revision: 433
          http://svn.sourceforge.net/stripes/?rev=433&view=rev
Author:   tfenne
Date:     2006-10-07 11:15:27 -0700 (Sat, 07 Oct 2006)

Log Message:
-----------
Fix for STS-271: html tags should not output attributes with empty values.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java

Modified: trunk/stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java   
2006-10-07 17:55:32 UTC (rev 432)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java   
2006-10-07 18:15:27 UTC (rev 433)
@@ -190,10 +190,14 @@
      */
     protected void writeAttributes(JspWriter writer) throws IOException {
         for (Map.Entry<String,String> attr: getAttributes().entrySet() ) {
+            // Skip the output of blank attributes!
+            String value = attr.getValue();
+            if (value == null || value.length() == 0) continue;
+
             writer.print(" ");
             writer.print(attr.getKey());
             writer.print("=\"");
-            writer.print( HtmlUtil.encode(attr.getValue()) );
+            writer.print( HtmlUtil.encode(value) );
             writer.print("\"");
         }
     }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to