New Features of ZK JSP Tags 1.2.0"

From Documentation
m (Created page with '{{Template:Smalltalk_Author| |author=Ian Tsai, Engineer, Potix Corporation |date=April 1, 2008 |version= }} =Support More Components= ZK JSP Tags 1.2 now supports ZK Google …')
(No difference)

Revision as of 09:20, 20 September 2010

DocumentationSmall Talks2008AprilNew Features of ZK JSP Tags 1.2.0
New Features of ZK JSP Tags 1.2.0

Ian Tsai, Engineer, Potix Corporation
April 1, 2008

Support More Components

ZK JSP Tags 1.2 now supports ZK Google Maps and Jasperreport components. For example:

<z:gmaps id="map" zoom="14">
	<z:attribute name="lng">121.55298871046938</z:attribute>
	<z:attribute name="lat">25.042063183495276</z:attribute>

As you can see, the rules of how to use ZK Google Map are the same as its in pure ZK. For more complexed demonstration, please take a look at /guide/index.jsp in ZK JSP Demo 1.2.0 :


If you want to know more about how to use ZK Gmaps, please refer to these smalltalks:

Supports variable-resolver Directive

Now in ZK JSP Tags, you can declare variable resolvers in topmost of JSP documents. Then you can use the variables of your resolvers in EL and zscript.

//assume there is a person bean in spring context...
<z:variable-resolver use="org.zkoss.zkplus.spring.DelegatingVariableResolver"/>
	<z:label value="${person.address}"/>
		 String A =;

For more detailed information about how to use ZK variable resolver, please refer to the ZK Developer's Guide: The variable-resolver Directive.

Supports ZK Expression Language in JSP

Now, you can use ZK components and zscript variables in EL expressions. For example:

<%@ taglib uri="" prefix="z" %>
<%@ taglib uri="" prefix="zfunc" %>

<z:page id="eltests">
		 String A = "This is page scope str A";
	<z:window id="myWin">
			 String A = "This is myWin's A";
		<z:label value="${A}"/>
		<z:label value="${self.title}"/>
	<z:label value="${A}"/>
	<z:label value="${}'s title is: ${myWin.title}"/>

As you can see, the behaviors of ZK variable resolving are the same as pure ZK. For more detailed information, please refer to the ZK JSP Tags User Guide.

Use ZK in JSP Document

To use ZK JSP Tags in JSP document is very easy. In JSP, ZK is a normal JSP tag library. So first, you must declare a taglib definition:

<%@ taglib uri="" prefix="zk" %>

The URL must be It is the key to access correct ZK library.

In ZK world, every ZK components must be contained by a Desktop instance. It will manage the Ajax connections of each component. In JSP, you have to specify a <zk:page> tag to initialize the Desktop instance if it's not existed:

<%@ taglib uri="" prefix="zk" %>
<zk:page zscriptlanguage="java" >
// The ZK Component Tags declaration Area...
// Wrong place to put ZK Component Tags...

And remember, all ZK JSP tag instances you declared must be rooted in a ZK page tag.

Finally, you can start to write ZK JSP tags you want. The usage of how to use all the features in ZK JSP is in ZK JSP Tags User Guide. Here is a sample:

<%@ taglib uri="" prefix="zk" %>
<zk:page zscriptlanguage="java" >
<zk:window title="My First Window" border="normal" width="200px">
	<zk:label id="labl" value="Hello, World!"/>
		<zk:button label="click me!"  onClick="labl.value='Hello ZK!'" />

Compare to pure ZK:

<window title="My First Window" border="normal" width="200px">
	<label id="labl" value="Hello, World!"/>
		<button label="click me!"  onClick='labl.value="Hello ZK!"' />

Both the result will looked like this.


Unsupported features in ZK JSP

Although ZK JSP almost supports all the features from pure ZK in this version, still there are some unsupported features:

  • "fufill" Attribute
  • <?xel-method?> Directive
  • <?evaluator?> Directive


ZK JSP Tags is a JSP Tag library that provides you a painless and powerfull solution to migrate your existent JSP web site to Ajax application. It implements all ZK components, almost all ZK features and supported all browsers. I hope you enjoy this release and give us feedbacks. Thank you.

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