//Use more compatible way.
UIComponent outputScript = facesContext.getApplication().
createComponent(facesContext, JAVAX_FACES_OUTPUT_COMPONENT_TYPE, DEFAULT_SCRIPT_RENDERER_TYPE);
outputScript.getAttributes().put(JSFAttr.NAME_ATTR, JSF_JS_RESOURCE_NAME);
outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, JAVAX_FACES_LIBRARY_NAME);
outputScript.encodeAll(facesContext);
}
else
{
//Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
Resource resource = facesContext.getApplication().getResourceHandler().createResource(