How to build your first ZK application with NetBeans

From Documentation
Revision as of 07:40, 10 September 2010 by Elton776 (talk | contribs) (Created page with '{{Template:Smalltalk_Author| |author=Tommaso Fin, Jave EE developper, the InfoCamere Group, Italy. |date=February 24, 2007 |version=ZK Studio 0.9 }} ===Requirements=== :1. [h…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
DocumentationSmall Talks2007FebruaryHow to build your first ZK application with NetBeans
How to build your first ZK application with NetBeans

Tommaso Fin, Jave EE developper, the InfoCamere Group, Italy.
February 24, 2007
ZK Studio 0.9


1. NetBeans 5.5
2. The last version of ZK libraries
3. An Application Server. In this example we use JBoss.


1. Launch the IDE NetBeans.Netbeans1.gif
2. Open a new project (File > New Project...) and choose the Web


Application category (Web>Web Application).

3. Give to the project the name you like (for example helloworld), select the project path, the application server and click the finish button.


4. Open the Web Pages > WEB-INF > web.xml file.


and Substitute the content with the follow:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="WebApp_ID" version="2.4" 
          <!-- /// -->
          <!-- DSP -->
      The servlet loads the DSP pages.
          <!-- /// -->

          <!-- //// -->
          <!-- 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>
          <!-- //// -->

5. Right-Click to the library folder and select "Add JAR/Folder...".


Add all the ZK Jars in the folder ZK-X.X.X/dist/lib/ and ZK-X.X.X/dist/lib/ext.


6. Now we have all set for create the our first zul file. Right-Click on the Web Pages folder and choose New > File/Folder.


Select Other > Empty file.


Give it the name "helloworld.zul" and click Finish.

7. Set the content of helloworld.zul file like this:
      <?xml version="1.0" encoding="utf-8"?>
      <?page title="ZK::Hello World!"?>
      <window title="My First window" border="normal" width="200px">
          Hello, World!

8. Now we can run the project Netbeans10.gif(F6) and see our first ZK page (if you test te project locally shold be at http://localhost:8080/helloworld/helloworld.zul)



Tommaso Fin is a Jave EE developer working for the InfoCamere Group, Italy. He has got a degree in Informatic Engenieering and have about 2 years of experience in LAMP architecture managment and development. He is now focusing on the development of web applications with a massive use of databases data.

Copyright © Tommaso Fin. This article is licensed under GNU Free Documentation License.