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.

Getting Started with <strong>ZK</strong><br />

It's notable that the alert method is not JavaScript, it's Java. The code within a ZUL<br />

page is interpreted inside the BeanShell interpreter (http://www.beanshell.org).<br />

To use JavaScript for the onClick event handler we have to explicitly prefix the<br />

command with javascript:. The difference between a JSP and ZUL page is that the<br />

code inside a <strong>ZK</strong> page is run inside the BeanShell, whereas a JSP is compiled to<br />

a Java class.<br />

The <strong>ZK</strong> framework itself runs in a JEE (Java Enterprise Edition) Web container. And<br />

to fulfill the requirements to run into such a container, we have to do (unfortunately)<br />

more than just creating such a page. The succeeding screenshot shows the project<br />

layout for the sample project.<br />

[ 12 ]

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

Saved successfully!

Ooh no, something went wrong!