code: private void addGeneratedResource(FacesContext context, String resourceName, String rendererType, String value,
                                        UIViewRoot view) {
          final UIOutput resource = new UIOutput();
          resource.getAttributes().put("name", resourceName);
          resource.setRendererType(rendererType);
          resource.getAttributes().put("library", value);
          view.addComponentResource(context, resource, HEAD);
      }
docs: Add a new resource.