if (null == defaultRenderKitId) {
defaultRenderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
}
RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder
.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
RenderKit renderKit = renderKitFactory.getRenderKit(context,
defaultRenderKitId);
ResponseWriter responseWriter = renderKit.createResponseWriter(
customWriter, null, "UTF-8");
context.setResponseWriter(responseWriter);
writeScriptBody(context, component, true);
result = customWriter.getContent();
if (writer != null) {
context.setResponseWriter(writer);
}else {
HttpServletResponse response = (HttpServletResponse)context.getExternalContext().getResponse();
PrintWriter wr = response.getWriter();
if (wr != null) {
context.setResponseWriter(renderKit.createResponseWriter(wr, null, "UTF-8"));
}
}
} else {
writeScriptBody(customWriter, (String) component
.getAttributes().get("label"));