From Documentation

Jump to: navigation, search

The ZK filter actually maps each HTML tag to the corresponding XHTML components. As described in the previous section, it consumes more memory than necessary since ZK has to maintain the states of all ZK components (including XUL and XHTML components).

Include ZUL pages in a JSP page

If some part of UI is made of HTML tags (such as header and banner), you could use JSP as the main page, implement the parts with dynamic content in ZUL, and then put them together with <jsp:include>. For example,

<%-- main.jsp --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
   <%-- the static part such as header --%>
   <div>any content you like</div>

   <%-- include the dynamic part --%>
   <jsp:include page="foo.zul"/>

Use ZK components directly in a JSP page with ZK JSP tags

If you prefer to use ZK components directly in a JSP page, you could use ZK JSP tags. For example,

<%-- another.jsp --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<%@ taglib uri="" prefix="z" %>

<html xmlns="">
    <z:zkhead />
  <%-- any JSP content --%>

where z:page declares a ZK page and then ZK tags can be used inside it.

The above example is equivalent to the following code snippet, if a ZUL page is used,

<!-- another.zul -->
<?page complete="true"?>
<n:html xmlns="" xmlns:n="">
  <!-- any HTML content -->


where <?page complete="true"?> declares that this page is a complete page, i.e., it will provide HTML's html, head and body tags as shown above.

Version History

Last Update : 2015/9/8

Version Date Content

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.