Create and Run Your First ZK Application Manually"
m |
|||
Line 35: | Line 35: | ||
===Create First ZUL file=== | ===Create First ZUL file=== | ||
Here is a simple zul file named '''hello.zul'''. | Here is a simple zul file named '''hello.zul'''. | ||
− | < | + | <source lang="xml"> |
<window title="My First ZK Application" border="normal"> | <window title="My First ZK Application" border="normal"> | ||
Hello World! | Hello World! | ||
</window> | </window> | ||
− | </ | + | </source> |
===Pack your project=== | ===Pack your project=== | ||
Line 49: | Line 49: | ||
<pre> | <pre> | ||
myZK.war | myZK.war | ||
− | + | ¦ hello.zul | |
− | + | ¦ | |
− | + | +-WEB-INF | |
− | + | ¦ web.xml | |
− | + | ¦ | |
− | + | +-lib | |
*.jar | *.jar | ||
</pre> | </pre> |
Revision as of 03:07, 22 September 2010
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.
- Now i create one for example named myZK
Install Library Distribution
- Unzip zk-bin-5.0.4.zip
- 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 Deployment Descriptor(Web.xml)
web.xml is called the web application deployment descriptor. This is a XML file that defines servlets, servlet mappings, listeners, filters, welcome files etc.
Deployment descriptor is a heart of any J2EE web application, so every web application must have a web.xml deployment descriptor directly under WEB-INF folder.
- For the content of web.xml, please refer to Sample of web.xml and Sample of web.xml for Servlet 2.3 (For some web container which support Servlet 2.3 only (e.g. Tomcat (4.x))
Create First ZUL file
Here is a simple zul file named hello.zul.
<window title="My First ZK Application" border="normal">
Hello World!
</window>
Pack your project
- Compress the myZK directory(e.g. myZK.zip)
- Rename myZK.zip to myZK.war
- Done!!
Confirm your ZK Web Archive (WAR) file
myZK.war ¦ hello.zul ¦ +-WEB-INF ¦ web.xml ¦ +-lib *.jar
Version History
Last Update : 2010/09/22
Version | Date | Content |
---|---|---|
5.0.4 | 9/21/2010 | Created |