How to Deploy ZK Applications to Jelastic Cloud
ZK affords developers the ability to write one application and make it provide an optimal user experience on any kind of device from the desktop to tablets and smartphones without the need for a separate component set. This technique uses responsive design and responsive components to make creating applications as easy and intuitive as possible.
ZK is trusted and established with a solid track record as the framework of choice across industries. Tens of thousands of developers use ZK to build their mission critical systems including multi-million dollar systems that serve millions of users and tens of thousands of concurrent sessions on an international scale.
With over 1,500,000 downloads, ZK empowers a wide variety of companies and institutions, ranging from small to large in multiple industries.
As any Java application and framework, ZK is very easy to deploy to Jelastic! Here’s how:
Create an environment
1. Go to Jelastic.com and sign up if you haven’t done it yet or log in with your Jelastic credentials by clicking the Sign In link on the page.
2. While in Jelastic dashboard, click the Create environment button:
3. In the Environment Topology dialog, pick your application server (for example, Tomcat 7). Then type your environment name, for example, zktest.
It will take just a minute for your environment to be created.
Upload Java package
1. Navigate to zkoss.org and download ZK framework free open source community edition.
2. Create your application using ZK framework as you usually do. All the necessary libraries you can find in dist/lib folder of the package you have just downloaded. In our case we use simple “Hello world” application (zweb.jar, zul.jar, zkplus.jar, zkbind.jar, zk.jar, zhtml.jar, zel.jar and zcommon.jar are included and located under zk-bin-x.x.x.x/dist/lib).
3. Upload your .war package to the Deployment manager.
5. Once the package is in Jelastic, deploy it to the environment you have just created.
6. Now you can open your app in a web browser. You’ll see the result of the next code execution:
<window title="My First Window" border="normal" width="200px">
7. Building UI with ZK is easy; simply combine and mix match from the hundreds of components readily at hand. For example, in our case we can put the appropriate corrections to index.zul file to get simple registration form without creation of the new war package and redeployment.
<window border="normal" width="400px" style="padding-top:20px;padding-left:20px;" title="Welcome! New User">
<auxheader colspan="2" label="Registration Form" style="font-size:16px"/>
User Name <textbox id="nameBox" hflex="1" constraint="no empty"/>
<radio label="Male" value="male" checked="true"/>
<radio label="Female" value="female"/>
Birthday <datebox id="birthdayBox" hflex="1" constraint="no empty, no today, no future"/>
<row spans="2" align="center" >
<checkbox id="acceptTermBox"/> Accept Term of Use
<row spans="2" align="right">
<button id="resetButton" label="Reset" />
<button id="submitButton" label="Submit" disabled="true"/>
That’s all for today, but we continue to post examples on how Jelastic supports your favorite Java applications out of the box with no code changes required. And if you feel like there is still something missing – please do not hesitate to let us know in the comments below.