Develop ZK Applications with Eclipse

From Documentation
DocumentationSmall Talks2006JuneDevelop ZK Applications with Eclipse
Develop ZK Applications with Eclipse

Andrew Ho, Principal Engineer, Potix Corporation
Jun 1, 2006
ZK Studio 0.9

Downloading ZK

Click here to download ZK.

Installation of Tomcat 5.5

You should install the most updated Tomcat first. You can find the document from Tomcat Setup.

Installation of Eclipse

It's easy to install Eclipse. You just download it and unpack it to a directory, ex c:/eclipse.

Eclipse Web Tools Platforms

Web Tools Platforms is a plug-in for developing web applications.

1. Install WTP

  • Open eclipse
  • From menu, Help/Software Updates/Find and Install...
  • Selected "Search for new feature..."
  • Click "New Remote Site" button
  • The dialog setting should looks like:
Name: Web Tools Platform (WTP)


2. Define a Server Runtime

  • From menu Window/Preferences...
  • In Server > Installed Runtime, Click "Add"
  • Select Apache > Apache Tomcat v5.5 and click Next
  • Browse to and select your Tomcat root directory e.g. C:\Program Files\Apache Software Foundation\Tomcat 5.5
  • Select JDK 1.5
  • Finish & OK


3. Define a Server Instance

  • From menu, Windows/Show Views/Others...,
  • Select Servers/Servers
  • In the "Servers" view, right click mouse(context menu) to add a new server


  • In the next dialog, you clicked "Next" button to add your projects to work with the server instance.


4. zul file extension with XML editor

  • From menu, Window/Preferences...
  • General > Content Types > XML, add "*.zul" file extension

5. New a ZK project

  • Create a Dynamic Web Project
  • From menu, File > New > Project
  • Select Web > Dynamic Web Project
  • Named your new project
  • Unpack your
  • Copy zk*/dist/lib/* & zk*/dist/lib/ext/* jar files to your $PRJ/WebContent/WEB-INF/lib
  • Updated your $PRJ/WebContent/WEB-INF/web.xml for ZK
<?xml version="1.0" encoding="UTF-8"?>
<web-app ...>

<!-- //// -->
<!-- ZK -->
	<description>Used to cleanup when a session is destroyed</description>
	<display-name>ZK Session Cleaner</display-name>
	<description>ZK loader for ZUML pages</description>
	<!-- Must. Specifies URI of the update engine (DHtmlUpdateServlet).
	It must be the same as <url-pattern> for the update engine.
	<description>The asynchronous update engine for ZK</description>
<!-- //// -->

<!-- /////////// -->
<!-- Miscellaneous -->


  • Your first ZK file, helloworld.zul
<?xml version="1.0" encoding="utf-8"?>
<?page title="ZK::Hello World!"?>

<window title="My First window" border="normal" width="200px">
	Hello, World!
  • Verification
Start/debug server from the "Servers" view


Download the sample



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