myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bara...@apache.org
Subject svn commit: r344332 - /myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/util/AddResource.java
Date Tue, 15 Nov 2005 08:21:57 GMT
Author: baranda
Date: Tue Nov 15 00:21:51 2005
New Revision: 344332

URL: http://svn.apache.org/viewcvs?rev=344332&view=rev
Log:
Fixes MYFACES-825. Thanks to Simon Kitching

Modified:
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/util/AddResource.java

Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/util/AddResource.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/util/AddResource.java?rev=344332&r1=344331&r2=344332&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/util/AddResource.java
(original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/util/AddResource.java
Tue Nov 15 00:21:51 2005
@@ -715,26 +715,27 @@
         if(bodyInsertPosition>0)
         {
             StringBuffer buf = new StringBuffer();
-
-            int i=0;
-
-            for (Iterator it = getBodyOnloadInfos(request).iterator(); it.hasNext();)
+            Set bodyInfos = getBodyOnloadInfos(request);
+            if (bodyInfos.size() > 0) 
             {
-                AttributeInfo positionedInfo = (AttributeInfo) it.next();
-                if(i==0)
+                int i=0;
+                for (Iterator it = getBodyOnloadInfos(request).iterator(); it.hasNext();)
                 {
-                    buf.append(positionedInfo.getAttributeName());
-                    buf.append("=\"");
+                    AttributeInfo positionedInfo = (AttributeInfo) it.next();
+                    if(i==0)
+                    {
+                        buf.append(positionedInfo.getAttributeName());
+                        buf.append("=\"");
+                    }
+                    buf.append(positionedInfo.getAttributeValue());
+    
+                    i++;
                 }
-                buf.append(positionedInfo.getAttributeValue());
 
-                i++;
+                buf.append("\"");
+                originalResponse.insert( bodyInsertPosition-1, " "+
+                        buf.toString());
             }
-
-            buf.append("\"");
-
-            originalResponse.insert( bodyInsertPosition-1, " "+
-                    buf.toString());
         }
 
         if (headerInsertPosition >= 0)



Mime
View raw message