Hello,
I would like to render a tapestry page, components and all in the
background. I will set up the page parameters and it will be initialized
correctly, but i want to do this in the background and pass down the html.
This is what I had, and it worked for the early versions of tapestry. Just
not 4.1.3
public static byte[] getPageRendering(IRequestCycle cycle, IPage page) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter(output, true);
MarkupFilter filter = new XmlMarkupFilter();
ResponseBuilder old = cycle.getResponseBuilder();
IMarkupWriter markup = new
MarkupWriterImpl(page.getResponseContentType().toString(), writer, filter);
ResponseBuilder builder = new DefaultResponseBuilder(markup,
cycle.getInfrastructure().getAssetFactory(), page.getNamespace().getId(),
false);
cycle.setResponseBuilder(builder);
page.renderPage(builder, cycle);
builder.getWriter().flush();
byte[] toByteArray = output.toByteArray();
try {
output.close();
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
cycle.setResponseBuilder(old);
return toByteArray;
}
Can someone please help?
Thanks,
LT
--
View this message in context:
http://www.nabble.com/Rendering-Page-in-background-%284.1.3%29-tf4792627.html#a13710215
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]