// Encode the closing </textarea> element.
responseWriter.endElement("textarea");
// Encode the script that contains functions with names specific to this component, so that they can be
// invoked directly by the JavaScript generated by the JSP tag.
WYSIWYGTemplate wysiwygTemplate = getWYSIWYGTemplate(facesContext);
String formattedTemplate = wysiwygTemplate.format(facesContext, inputRichText);
responseWriter.startElement(StringPool.SCRIPT, uiComponent);
responseWriter.writeAttribute(StringPool.TYPE, ContentTypes.TEXT_JAVASCRIPT, null);
responseWriter.write(formattedTemplate);
responseWriter.endElement(StringPool.SCRIPT);