Create and Run Your First ZK Spreadsheet Application"
Jimwatkins (talk | contribs) m |
|||
(20 intermediate revisions by 5 users not shown) | |||
Line 2: | Line 2: | ||
==Create Web Application== | ==Create Web Application== | ||
− | ZK Web | + | 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. | + | When developing ZK web applications, you must follow this structure so that the application can be deployed in any J2EE compliant web server. |
''All you need to do is create a web application directory with related files.'' | ''All you need to do is create a web application directory with related files.'' | ||
Line 10: | Line 10: | ||
− | *Create one for example named <span style="color:green">'''myZSS'''</span> | + | *Create one for example named <span style="color:green">'''myZSS'''</span><ref>You can download sample application myZSS.war described in this document from [http://zkbooks.googlecode.com/files/myZSS.war here]</ref> |
− | + | <blockquote> | |
+ | ---- | ||
+ | <references/> | ||
+ | </blockquote> | ||
===Install ZK Library Distribution=== | ===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 [www.zkoss.org/download/zk.dsp here] | + | #Unzip zk-bin-5.0.5.zip. You should have already downloaded this file as described in the previous chapter or download it now from [http://www.zkoss.org/download/zk.dsp here] |
− | #Copy JAR files under | + | #Copy JAR files under the following list to <u>'''myZSS'''/WEB-INF/lib</u> |
#:* {YOUR_ZK_UNZIP_FOLDER}/dist/lib | #:* {YOUR_ZK_UNZIP_FOLDER}/dist/lib | ||
#:* {YOUR_ZK_UNZIP_FOLDER}/dist/lib/ext | #:* {YOUR_ZK_UNZIP_FOLDER}/dist/lib/ext | ||
Line 21: | Line 24: | ||
===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> | ||
#:* {YOUR_ZK_SPREADSHEET_UNZIP_FOLDER}/dist/lib | #:* {YOUR_ZK_SPREADSHEET_UNZIP_FOLDER}/dist/lib | ||
#:* {YOUR_ZK_SPREADSHEET_UNZIP_FOLDER}/dist/lib/ext | #:* {YOUR_ZK_SPREADSHEET_UNZIP_FOLDER}/dist/lib/ext | ||
− | |||
===Create Deployment Descriptor(Web.xml)=== | ===Create Deployment Descriptor(Web.xml)=== | ||
Line 34: | Line 36: | ||
− | *For the content of <u>web.xml</u>, please refer to [ | + | *For the content of <u>web.xml</u>, please refer to [[ZK_Installation_Guide/ZK_Background/Sample_of_web.xml|Sample of web.xml]] and [[ZK_Installation_Guide/ZK_Background/Sample_of_web.xml_for_Servlet_2.3| 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=== | ===Create a sample MS Excel file=== | ||
Line 40: | Line 42: | ||
#Create a new Excel spreadsheet | #Create a new Excel spreadsheet | ||
#Enter "Hello from ZK Spreadsheet" in the first or any empty cell | #Enter "Hello from ZK Spreadsheet" in the first or any empty cell | ||
− | #Save this file as "HelloZSS.xlsx" | + | #Save this file as "HelloZSS.xlsx" into <u>'''myZSS'''/WEB-INF</u> location |
− | |||
===Create First ZUL file=== | ===Create First ZUL file=== | ||
Line 50: | Line 51: | ||
<window title="My First ZK Spreadsheet Application" | <window title="My First ZK Spreadsheet Application" | ||
border="normal"> | border="normal"> | ||
− | <spreadsheet src="HelloZSS.xlsx" maxrows="100" | + | <spreadsheet src="/WEB-INF/HelloZSS.xlsx" maxrows="100" maxcolumns="100" width="50%" /> |
</window> | </window> | ||
</zk> | </zk> | ||
Line 60: | Line 61: | ||
#Done!! | #Done!! | ||
− | ==Confirm your ZK Spreadsheet Web Archive (WAR) file== | + | ==Confirm your ZK Spreadsheet application Web Archive (WAR) file== |
<pre> | <pre> | ||
myZSS.war | myZSS.war | ||
¦ helloZSS.zul | ¦ helloZSS.zul | ||
− | |||
- WEB-INF | - WEB-INF | ||
¦ web.xml | ¦ web.xml | ||
− | ¦ | + | ¦ HelloZSS.xlsx |
- lib | - lib | ||
*.jar | *.jar | ||
Line 77: | Line 77: | ||
− | ==Download | + | ==Download== |
− | + | [http://zkbooks.googlecode.com/files/myZSS.war myZSS.war] | |
=Version History= | =Version History= |
Latest revision as of 06:16, 12 April 2012
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 the 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[1]
Install ZK Library Distribution
- Unzip zk-bin-5.0.5.zip. You should have already downloaded this file as described in the previous chapter or download it now from here
- Copy JAR files under the 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="/WEB-INF/HelloZSS.xlsx" maxrows="100" maxcolumns="100" width="50%" />
</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
Version History
Version | Date | Content |
---|---|---|