pageContext.setProtocol(protocol);
// Create a region
Region region = new Region((CanvasLayout) layout);
RegionInstance instance =
(RegionInstance) dlContext.getFormatInstance(region,
NDimensionalIndex.ZERO_DIMENSIONS);
RegionContent content = new RegionContent() {
public void render(FormatRendererContext ctx) {
OutputBufferStack outputBufferStack = ctx.getOutputBufferStack();
DOMOutputBuffer buffer = (DOMOutputBuffer)
outputBufferStack.getCurrentOutputBuffer();
buffer.openElement(buffer.allocateElement("regionContent"));
buffer.closeElement("regionContent");
}
};
RegionContent content2 = new RegionContent() {
public void render(FormatRendererContext ctx) {
OutputBufferStack outputBufferStack = ctx.getOutputBufferStack();
DOMOutputBuffer buffer = (DOMOutputBuffer)
outputBufferStack.getCurrentOutputBuffer();
buffer.openElement(buffer.allocateElement("regionContent2"));
buffer.closeElement("regionContent2");
}
};
instance.addRegionContent(content);
instance.addRegionContent(content2);
//Render the format
FormatRenderer renderer = new RegionRenderer();
renderer.render(formatRendererContext, instance);