Create and Run Your First ZK Spreadsheet Application"
Line 21: | Line 21: | ||
===Install ZK Spreadsheet Library Distribution=== | ===Install ZK Spreadsheet Library Distribution=== | ||
− | Download ZK | + | Download ZK Spreadsheet libraries archive "zk-spreadsheet-bin-2.0.0.zip" from [http://www.zkoss.org/download/zkspreadsheet.dsp ZK Spreadsheet Download page] and save it into a folder. |
#Unzip zk-spreadsheet-bin-2.0.0.zip | #Unzip zk-spreadsheet-bin-2.0.0.zip | ||
#Copy JAR files under following list to <u>'''myZSS'''/WEB-INF/lib</u> | #Copy JAR files under following list to <u>'''myZSS'''/WEB-INF/lib</u> |
Revision as of 04:29, 24 December 2010
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.
- Create one for example named myZSS
Install ZK Library Distribution
- Unzip zk-bin-5.0.5.zip. You should have already downloaded this file as described in previous chapter or download it now from here
- Copy JAR files under following list to myZSS/WEB-INF/lib
- {YOUR_ZK_UNZIP_FOLDER}/dist/lib
- {YOUR_ZK_UNZIP_FOLDER}/dist/lib/ext
- {YOUR_ZK_UNZIP_FOLDER}/dist/lib/zkforge
Install ZK Spreadsheet Library Distribution
Download ZK Spreadsheet libraries archive "zk-spreadsheet-bin-2.0.0.zip" from ZK Spreadsheet Download page and save it into a folder.
- Unzip zk-spreadsheet-bin-2.0.0.zip
- Copy JAR files under following list to myZSS/WEB-INF/lib
- {YOUR_ZK_SPREADSHEET_UNZIP_FOLDER}/dist/lib
- {YOUR_ZK_SPREADSHEET_UNZIP_FOLDER}/dist/lib/ext
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 a sample MS Excel file
- Open MS Excel
- Create a new Excel spreadsheet
- Enter "Hello from ZK Spreadsheet" in the first or any empty cell
- Save this file as "HelloZSS.xlsx" into myZSS/WEB-INF location
Create First ZUL file
Create a simple zul file named hello.zul under "myZSS" folder and enter following contents in it.
<?page title="My First ZK Spreadsheet application" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="My First ZK Spreadsheet Application"
border="normal">
<spreadsheet src="HelloZSS.xlsx" maxrows="100" maxcols="100" />
</window>
</zk>
Pack your project
- Compress the myZSS directory(e.g. myZSS.zip)
- Rename myZSS.zip to myZSS.war
- Done!!
Confirm your ZK Spreadsheet application Web Archive (WAR) file
myZSS.war ¦ helloZSS.zul - WEB-INF ¦ web.xml ¦ HelloZSS.xlsx - lib *.jar
Deploy and run your first ZK Spreadsheet application
- Copy myZSS.war to web server web applications folder. For Tomcat it would be TOMCAT_HOME/webapps folder
- Open Browser and visit http://localhost:8080/myZSS/helloZSS.zul
Download sample application
You can download sample application myZSS.war described in this document from here
Version History
Version | Date | Content |
---|---|---|