ZKTM Small Talks |
ZK Sample Application |
| Simply Rich | Michael Lee Principal Systems Analyst The Kowloon Motor Bus Co. (1933) Limited May 29, 2006 |
ZK is a powerful Ajax framework which let developer create "Rich" web application without using any Javascript, just Java. Although a very attractive Live Demo available, new comer (like me) still wonder how to get started with an application. This article try to show you how an application can be easily build and some of the possibilities with ZK. (Due to my limited experience with the framework - less than 3 months, it is not the best approach).
I ported the first Java Web Application I encountered (2-3 years ago) to ZK, it is the example application that come with Struts. During this process, all business objects of Struts-Example has been reused without amendment. This is a very simple example, however it can demonstrate how to implement screen flow, how to perform data validation and how to access business logic layer. Also, in this sample, I have used the Live Data listbox with a custom ListitemRenderer to display multiple columns, implement a custom event, passing parameter on window creation and other skills required to create a real-life application.
Following is the screenshots for original and transformed application.
Screenshots of Strut Sample Application
Click to zoom the images
Screenshots of ZK Sample Application
Click to zoom the images
To port the application, follows steps performed:
To run ZK, you need a Web Container which support Servlet 2.4. If you have ZK installed, just deploy the zk-sample.war to the Container. For Tomcat, it means copy it to webapps. To install the sample application bundled with ZK (1.2.0 RC3), use zk-sample-full.war.

Michael Lee is a Principal Systems Analyst working for The Kowloon Motor Bus Co. (1933) Limited (Hong Kong). His major responsibility is on application design and implementation on client/server architecture using Powerbuilder. Experience on Java and Web development is limited.