public void renderPage(IRequestCycle cycle, String pageName)
throws IOException
{
cycle.activate(pageName);
IPage page = cycle.getPage();
ContentType contentType = page.getResponseContentType();
PrintWriter printWriter = _response.getPrintWriter(contentType);
IMarkupWriter writer = _markupWriterSource.newMarkupWriter(printWriter,
contentType);
String namespace = _response.getNamespace();
IMarkupWriter nested = writer.getNestedWriter();
ResponseBuilder builder = new DefaultResponseBuilder(nested);
PageRenderSupportImpl support = new PageRenderSupportImpl(
_assetFactory, namespace, null, builder);
TapestryUtils.storePageRenderSupport(cycle, support);
builder.renderResponse(cycle);
String id = "Tapestry Portlet " + _applicationId + " " + namespace;
writer.comment("BEGIN " + id);
writer.comment("Page: " + page.getPageName());
writer.comment("Generated: " + new Date());
writer.comment("Framework version: " + Tapestry.VERSION);
support.writeBodyScript(writer, cycle);