Package org.zkoss.zk.ui.sys
Interface PageRenderPatch
public interface PageRenderPatch
A patch that is used to process the rendering result of a page.
Currently, it is used only by
DHtmlLayoutPortlet
to allow the deployer to plug-in a patch for particular portal container.
To specify a patch, use a library property called
"org.zkoss.zk.portlet.PageRenderPatch.class" (refer to Attributes.PORTLET_RENDER_PATCH_CLASS.
- Since:
- 5.0.0
- Author:
- tomyeh
-
Method Summary
Modifier and TypeMethodDescriptionbeforeRender(RequestInfo reqInfo) Called before rendering to test if the patch shall be applied.voidpatchRender(RequestInfo reqInfo, Page page, Writer result, Writer out) Called after rendering to patch the result.
-
Method Details
-
beforeRender
Called before rendering to test if the patch shall be applied.- Parameters:
reqInfo- the request information- Returns:
- null if no need of patch, or a writer if the patch is required.
The writer will be used to hold the rendering result of the portlet.
Thus, you can process it later in
patchRender(org.zkoss.zk.ui.sys.RequestInfo, org.zkoss.zk.ui.Page, java.io.Writer, java.io.Writer)(so the writer is usually an instance of StringWriter).
-
patchRender
Called after rendering to patch the result. IfbeforeRender(org.zkoss.zk.ui.sys.RequestInfo)returns null, this method won't be called since nothing to patch.If
beforeRender(org.zkoss.zk.ui.sys.RequestInfo)returns a writer, the writer will become the result argument.- Parameters:
reqInfo- the request informationresult- the result returned bybeforeRender(org.zkoss.zk.ui.sys.RequestInfo), and the rendering result of a page will be written to it.out- the real output sent to the client. It is the writer to write the patched result to.- Throws:
IOException
-