Create and Run Your First ZK Application Manually"

From Documentation
m (Created page with '{{ZKInstallationGuidePageHeader}} =Create your first application= Here is how to create a Web application manually without IDE or other tools. It is easy to find the similar pro…')
 
Line 2: Line 2:
 
=Create your first application=
 
=Create your first application=
  
Here is how to create a Web application manually without IDE or other tools. It is easy to find the similar procedure with your preferred IDE or tools, such as Eclipse and NetBeans.
+
Here shows you how to create a web application manually without IDE or other tools.  
  
==Download ZK==
+
==Download ZK Libraries==
  
First, download the ZK libraries from http://www.zkoss.org/download/zk.dsp and save it to a proper location.例如zk-bin-5.0.4.zip
+
First, download the ZK libraries (Now is  ''zk-bin-5.0.4.zip'')  from [http://www.zkoss.org/download/zk.dsp ZK Download] and save it to a proper location.
  
==Create a Web application==
+
==Create Web application==
 +
ZK Web Applications use a standard directory structure defined in the Servlet specification.
 +
When developing ZK web applications, you must follow this structure so that application can be deployed in any J2EE compliant web server.
  
Creating a Web application is easy: just create some directory.
+
''All you need to do is create a web application directory  with related files.''
 +
[[File:J2EEWebApplication.jpg]]
  
:myZK
 
:myZK/WEB-INF
 
:myZK/WEB-INF/lib
 
  
===Deploy ZK libraries===
+
*Now i create one for example named <span style="color:green">'''myZK'''</span>
1. Unzip zk-bin-5.0.4.zip
+
===Install Library Distribution===
2. Copy JAR files under dist/lib            to myZK/WEB-INF/lib
+
#Unzip zk-bin-5.0.4.zip
  3. Copy JAR files under dist/lib/ext       to myZK/WEB-INF/lib
+
#Copy JAR files under following list to <u>'''myZK'''/WEB-INF/lib</u>
4. Copy JAR files under dist/lib/zkforge to myZK/WEB-INF/lib
+
#:* {YOUR_ZK_UNZIP_FOLDER}/dist/lib  
 +
#:* {YOUR_ZK_UNZIP_FOLDER}/dist/lib/ext
 +
#:* {YOUR_ZK_UNZIP_FOLDER}/dist/lib/zkforge  
  
 
===Create web.xml===
 
===Create web.xml===

Revision as of 08:23, 21 September 2010


DocumentationZK Installation GuideQuick StartCreate and Run Your First ZK Application Manually
Create and Run Your First ZK Application Manually



Create your first application

Here shows you how to create a web application manually without IDE or other tools.

Download ZK Libraries

First, download the ZK libraries (Now is zk-bin-5.0.4.zip) from ZK Download and save it to a proper location.

Create Web application

ZK Web Applications use a standard directory structure defined in the Servlet specification. When developing ZK web applications, you must follow this structure so that application can be deployed in any J2EE compliant web server.

All you need to do is create a web application directory with related files. J2EEWebApplication.jpg


  • Now i create one for example named myZK

Install Library Distribution

  1. Unzip zk-bin-5.0.4.zip
  2. Copy JAR files under following list to myZK/WEB-INF/lib
    • {YOUR_ZK_UNZIP_FOLDER}/dist/lib
    • {YOUR_ZK_UNZIP_FOLDER}/dist/lib/ext
    • {YOUR_ZK_UNZIP_FOLDER}/dist/lib/zkforge

Create web.xml

Create web.xml under myZK/WEB-INF. For the content of web.xml, please refer to Sample of web.xml

For older Tomcat (4.x) that supports only Servlet 2.3, please refer to Sample of web.xml for Servlet 2.3

Create hello.zul

For example, we can create a simple page to myZK, say, hello.zul with the following content.

<window title="My First ZK Application" border="normal">
	Hello World!
</window>

Compress this folder

壓縮myZK成為myZK.zip,rename to myZK.war

c:\>"C:\Program Files\7-Zip\7z.exe" a -tzip c:\myZK c:\myZK\*

確認你的ZK.war的內容

myZK.war
│  hello.zul
│  
└─WEB-INF
    │  web.xml
    │  
    └─lib
            *.jar


Version History

Last Update : 2010/09/21

Version Date Content
5.0.4 9/21/2010 Created



Last Update : 2010/09/21

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