@@ -0,0 +1,1019 @@
+package com.github.aureliano.verbum_domini.web.ui;%0A%0Aimport java.io.IOException;%0A%0Aimport javax.faces.component.FacesComponent;%0Aimport javax.faces.component.UIComponentBase;%0Aimport javax.faces.context.FacesContext;%0A%0Aimport com.github.aureliano.verbum_domini.helper.UrlHelper;%0A%0A@FacesComponent(%0A%09%09value = %22com.github.aureliano.verbum_domini.web.ui.HtmlScript%22,%0A%09%09tagName = %22script%22, createTag = true%0A%09)%0Apublic class HtmlScript extends UIComponentBase %7B%0A%0A%09public HtmlScript() %7B%0A%09%09super();%0A%09%7D%0A%0A%09@Override%0A%09public String getFamily() %7B%0A%09%09return %22custom.ui.verbum_domini%22;%0A%09%7D%0A%09%0A%09@Override%0A%09public void encodeBegin(FacesContext facesContext) throws IOException %7B%0A%09%09StringBuilder tag = new StringBuilder();%0A%0A%09%09tag.append(%22%3Cscript%22);%0A%09%09%0A%09%09String source = (String) super.getAttributes().get(%22source%22);%0A%09%09if (source != null) %7B%0A%09%09%09String url = UrlHelper.buildWebAppUrl(%22js/%22 + source + %22.js%22);%0A%09%09%09tag.append(%22 src=%5C%22%22 + url + %22%5C%22%22);%0A%09%09%7D%0A%09%09%0A%09%09tag.append(%22%3E%3C/script%3E%22);%0A%09%09%0A%09%09facesContext.getResponseWriter().write(tag.toString());%0A%09%7D%0A%7D

Create custom script tag component.