Class Renders

java.lang.Object
org.zkoss.zkplus.embed.Renders

public class Renders extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static class 
    A special page renderer that renders a page without generating the HTML tag of the page.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    Outputs the HTML tags of the given component to the given writer.
    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)
    Outputs the HTML tags of the given component to the given writer with additional control.
    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)
    Outputs the HTML tags of the given component to the given writer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.ServletException
      IOException
      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 as render(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 use render(ServletContext, HttpServletRequest, HttpServletResponse, Component, String, Writer) instead.
      Throws:
      jakarta.servlet.ServletException
      IOException
      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 use render(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.ServletException
      IOException
      Since:
      5.0.8