You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2012/06/19 15:01:10 UTC
svn commit: r1351693 -
/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java
Author: bommel
Date: Tue Jun 19 13:01:09 2012
New Revision: 1351693
URL: http://svn.apache.org/viewvc?rev=1351693&view=rev
Log:
(TOBAGO-1076)
Move the generated javascripts for the components to the end of the html document
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java?rev=1351693&r1=1351692&r2=1351693&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/HtmlResponseWriter.java Tue Jun 19 13:01:09 2012
@@ -148,14 +148,22 @@ public class HtmlResponseWriter extends
}
@Override
- public void endDocument() throws IOException {
- String javascript = getJavascript();
- if (org.apache.commons.lang.StringUtils.isNotEmpty(javascript)) {
- startElement(HtmlElements.SCRIPT, null);
- writeAttribute(HtmlAttributes.TYPE, "text/javascript", false);
- write(getJavascript());
- endElement(HtmlElements.SCRIPT);
+ public void endElement(String name) throws IOException {
+ if (name == HtmlElements.BODY) {
+ String javascript = getJavascript();
+ if (org.apache.commons.lang.StringUtils.isNotEmpty(javascript)) {
+ startElement(HtmlElements.SCRIPT, null);
+ writeAttribute(HtmlAttributes.TYPE, "text/javascript", false);
+ write(getJavascript());
+ endElement(HtmlElements.SCRIPT);
+ }
}
+ super.endElement(name);
+ }
+
+ @Override
+ public void endDocument() throws IOException {
+
endElement(HtmlElements.HTML);
}
}