I was wondering if anyone has experience with using some kind of templating language for generating the html output in the component's renderer.
It seems to me that doing stuff like the following is difficult to maintain if your component rendering will suffer changes during its life.
writer.write('\n');
writer.startElement("script", null);
writer.writeAttribute("type", "text/javascript", null);
writer.writeAttribute("language", "Javascript", null);
writer.write("var checkbox_off = \"" + CHECKBOX_OFF_IMAGE_PATH + "\";\n");
writer.write("var checkbox_on = \"" + CHECKBOX_ON_IMAGE_PATH + "\";\n\n");
writer.write("cache1 = new Image("
+ CHECKBOX_IMAGE_WIDTH
+ ","
+ CHECKBOX_IMAGE_HEIGHT
+ ");\n");
writer.write("cache1.src=checkbox_off;\n");
...
I have seen articles discussing the use of Velocity as the renderer templating language (http://people.apache.org/~matzew/jsfvelocity.html) but I was wordering how other JSF component developers have solved this problem and whether there is a more general consensus on how to handle this problem.