When using the JSP tag writeHeadContribution with xhtml=true, the CDATA tags which are written are correct for pages served as XML (#1), but wrong for page served as text/html (#2).
But the second option is mainly used, because it enables a better compatibility across browsers.
#1. For a XHTML page served as XML (text/xml, application/xml, application/xhtml+xml), it must be:
#2. For a XHTML page served as text/html, the CDATA tags must be: