portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r810442 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
Date Wed, 02 Sep 2009 09:59:36 GMT
Author: woonsan
Date: Wed Sep  2 09:59:36 2009
New Revision: 810442

URL: http://svn.apache.org/viewvc?rev=810442&view=rev
Log:
JS2-1058: Write JS_PORTLET_HEAD_ELEMENTS only when any head element is contributed.
Just applied the suggestion by Lance Zhang. Thank you so much!

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java?rev=810442&r1=810441&r2=810442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
Wed Sep  2 09:59:36 2009
@@ -100,8 +100,9 @@
         {            
             context.getResponse().setHeader( "JS_PORTLET_TITLE", StringEscapeUtils.escapeHtml(
contentFragment.getPortletContent().getTitle() ) );
         }
-
+        
         writeHeadElements(context, window);
+        
         context.getResponse().getWriter().write(contentFragment.getRenderedContent());
         PortletContent content = contentFragment.getPortletContent();
         
@@ -114,19 +115,20 @@
     protected void writeHeadElements(RequestContext context, PortletWindow window) throws
IOException
     {
         List<KeyValue<String, Element>> headElements = window.getHeadElements();
-        PrintWriter out = context.getResponse().getWriter();
 
-        out.println("<JS_PORTLET_HEAD_ELEMENTS>");
-        
         if (!headElements.isEmpty())
         {
+            PrintWriter out = context.getResponse().getWriter();
+            
+            out.println("<JS_PORTLET_HEAD_ELEMENTS>");
+            
             for (KeyValue<String, Element> kvPair : headElements)
             {
                 out.println(DOMUtils.stringifyElementToHtml(kvPair.getValue()));
             }
+            
+            out.print("</JS_PORTLET_HEAD_ELEMENTS>");
         }
-        
-        out.print("</JS_PORTLET_HEAD_ELEMENTS>");
     }
     
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message