//Tests the handling of a comment in a nested template.
public void testNested() throws Exception {
loadConfigFiles(null, null);
Clay clay = (Clay) application.createComponent("org.apache.shale.clay.component.Clay");
clay.setId("test");
clay.setJsfid("/org/apache/shale/clay/config/layout.html");
clay.setManagedBeanName("test");
//the clayJsfid in the layout.html is a early EL "#{viewId}"
request.setAttribute("viewId", "/org/apache/shale/clay/config/comment.html");
//builds a buffer to write the page to
StringWriter writer = new StringWriter();
//create a buffered response writer
ResponseWriter buffResponsewriter = facesContext.getRenderKit()
.createResponseWriter(writer, null, response.getCharacterEncoding());
//push buffered writer to the faces context
facesContext.setResponseWriter(buffResponsewriter);
//start a document
buffResponsewriter.startDocument();
clay.encodeBegin(facesContext);
clay.encodeChildren(facesContext);
clay.encodeEnd(facesContext);
//end the document
buffResponsewriter.endDocument();
Parser p = new Parser();