23.12.2012 Views

ZK Developer's Guide

ZK Developer's Guide

ZK Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

[ 51 ]<br />

Chapter 2<br />

With the help of this context file, we can directly see the changes of our development,<br />

since, we set the root of the web application to the development directory.<br />

Deployment of the demo application<br />

The folder structure of the demo application is the Maven structure<br />

(http://maven.apache.org/). To deploy the application, create<br />

a new subdirectory (e.g. zk-media-lib) in the webapps directory of<br />

Tomcat and copy everything from the webapp directory of the application<br />

to this new subdirectory. Don't forget to copy the libraries, too. After<br />

that, you can start your Tomcat and run the application with<br />

http://localhost:8080/zk-media-lib (if your Tomcat is running<br />

on port 8080).<br />

Creating the Pages<br />

After the implementation of the model classes (which is not in the scope of this book)<br />

it's time to start with implementing the ZUL pages. The first page is index.zul<br />

which should be a simple navigation page for the individual pages. A simple way to<br />

execute the individual pages is to offer links for each page on the starting page. In a<br />

simple HTML page, we would use a href tag. In a ZUL page the preferred way is to<br />

use toolbarbutton. With the following line we add a link to add-media.zul:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!