[ http://issues.apache.org/jira/browse/TOMAHAWK-722?page=comments#action_12439725 ] Martin Marinschek commented on TOMAHAWK-722: --------------------------------------------
If the correct content-type is set, the HtmlResponseWriter of MyFaces will automatically emit the statements, that's why the tomahawk-components don't do it. Isn't there a similar functionality in the RI, or do they not care about scripts specifically? regards, Martin > Javascript in Tomahawk components produces invalid markup when output as > application/xhtml + xml with 1.2 RI > ------------------------------------------------------------------------------------------------------------- > > Key: TOMAHAWK-722 > URL: http://issues.apache.org/jira/browse/TOMAHAWK-722 > Project: MyFaces Tomahawk > Issue Type: Bug > Affects Versions: 1.1.5-SNAPSHOT > Environment: JSF 1.2_02 RI, JBoss 4.0.4 (tomcat 5.5), facelets > Reporter: reind > Fix For: 1.1.5-SNAPSHOT > > > The JSF 1.2 RI will output to Content-Type application/xhtml+xml instead of > text/html when a page is viewed with Firefox. Tomahawk components do not > properly escape the Javascript when they're rendered as application/xhtml+xml > and so they produce invalid markup and the pages are not displayed in Firefox. > The fix is to enclose any javascript in CDATA elements like the following: > <script> > <![CDATA[ > ... script content here ... > -- ]]> > </script> > This was not a problem in the JSF 1.1 RI or MyFaces because they always > output to text/html. > Ref: > 1. http://www.codehouse.com/javascript/tips/xhtml/ -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
