Package org.zkoss.zkplus.embed
Class Renders
java.lang.Object
org.zkoss.zkplus.embed.Renders
Utilities to embed ZK component(s) as a native JSF component, a JSP tag, Zimlet or others.
It allows application developers to use the native element without knowing the existence of ZK.
For example, ZK Spreadsheet for JSF is a native JSF component made in this way.
Example:
Calendar cal = new Calendar();
Renders.render(config.getServletContext(), request, response, cal, null, out);
See also Embed ZK Component in Foreign Framework.
- Since:
- 5.0.5
- Author:
- tomyeh
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA special page renderer that renders a page without generating the HTML tag of the page. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidrender(jakarta.servlet.ServletContext ctx, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.zkoss.zk.ui.Component comp, String path, Writer out) Outputs the HTML tags of the given component to the given writer.static final voidrender(jakarta.servlet.ServletContext ctx, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.zkoss.zk.ui.Richlet richlet, String path, boolean pageDOM, Writer out) Outputs the HTML tags of the given component to the given writer with additional control.static final voidrender(jakarta.servlet.ServletContext ctx, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.zkoss.zk.ui.Richlet richlet, String path, Writer out) Outputs the HTML tags of the given component to the given writer.
-
Constructor Details
-
Renders
public Renders()
-
-
Method Details
-
render
public static final void render(jakarta.servlet.ServletContext ctx, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.zkoss.zk.ui.Component comp, String path, Writer out) throws jakarta.servlet.ServletException, IOException Outputs the HTML tags of the given component to the given writer.- Parameters:
comp- the component to output (never null). It might have child components.path- the request path. If null, the servlet path is assumed.out- the output (never null).- Throws:
jakarta.servlet.ServletExceptionIOException- Since:
- 5.0.5
-
render
public static final void render(jakarta.servlet.ServletContext ctx, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.zkoss.zk.ui.Richlet richlet, String path, Writer out) throws jakarta.servlet.ServletException, IOException Outputs the HTML tags of the given component to the given writer. It is the same asrender(ctx, request, response, richlet, path, false, out).- Parameters:
path- the request path. If null, the servlet path is assumed.out- the output (never null).richlet- the richlet to run. If you have only one component to show and no need process it under an execution, you could userender(ServletContext, HttpServletRequest, HttpServletResponse, Component, String, Writer)instead.- Throws:
jakarta.servlet.ServletExceptionIOException- Since:
- 5.0.5
-
render
public static final void render(jakarta.servlet.ServletContext ctx, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.zkoss.zk.ui.Richlet richlet, String path, boolean pageDOM, Writer out) throws jakarta.servlet.ServletException, IOException Outputs the HTML tags of the given component to the given writer with additional control.- Parameters:
path- the request path. If null, the servlet path is assumed.out- the output (never null).richlet- the richlet to run. If you have only one component to show and no need process it under an execution, you could userender(ServletContext, HttpServletRequest, HttpServletResponse, Component, String, Writer)instead.pageDOM- whether to generate the DOM element to represent the page. In other words, if true is specified, the content will be enclosed with an additional DIV element representing the tag.- Throws:
jakarta.servlet.ServletExceptionIOException- Since:
- 5.0.8
-