Before you start
ZK is analogous to Ajax without JavaScript. It is a powerful framework composed of an Ajax-based event-driven engine, a rich set of XHTML and XUL components, and a markup language called ZUML for the purpose of creating feature-rich user interfaces. For a detailed example of the power of ZK and a real life example, see a link to the article Rich Internet applications using ZK in the Resources section.
The aim of this tutorial is to develop a rich sample application using the ZK framework and an Informix database. ZK is an open-source Ajax framework which facilitates the creation of Ajax-driven websites using Java. Developers can make use of ZK's event-driven framework and markup languages to create powerful applications quickly and effectively.
This tutorial will guide you through every step of the process and is aimed at new users of ZK. Although no JavaScript experience is required, users should have some experience with Java before starting.
Before you begin, ensure that done the following:
- You have installed a servlet container, for example Apache Tomcat in the Resources section.
- You have installed ZK. The link to download ZK is located in the Resources section of this tutorial.
- You have installed the JDBC driver for Informix. Check the Resources section for the link.
- You have installed Informix 11.50 or later. The Resources section includes a link for downloading a trial or free version of Informix. This tutorial was developed using Informix 11.50.TC4 Developer Edition.
This application follows the model-view-controller (MVC) architectural pattern, separating business logic from the user interface, enabling separation of user interfaces (contained in zul files) from Java business logic. This separation of concerns leads to cleaner and more maintainable code.
Refer to the Download section of this tutorial for a link to the ZK-Informix-Article-src.zip file that contains numerous files. The following list categorizes these files with respect to the MVC pattern:
- Model: Department.java, Employee.java, EmployeesDAO.java, DepartmentDAO.java, BaseDAO.java, DatabaseInformation.java, QuerySet.java, EmployeeQuerySet.java, DepartmentQuerySet.java, SqlPropertyLoader.java
- View: main.zul, employees.zul, departments.zul
- Controller: DatabaseSetupController.java, DepartmentController.java, EmployeeController.java, MainController.java
Note that the file DatabaseInformation.java contains all the settings that the application will use when accessing the database. If you choose you can manually change the settings of this file, and then access main.zul.



