Create and Run Your First ZK Spreadsheet Application"
m |
Jimwatkins (talk | contribs) m |
||
(5 intermediate revisions by one other user not shown) | |||
Line 4: | Line 4: | ||
ZK Web applications use a standard directory structure defined in the Servlet specification. | 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 17: | Line 17: | ||
===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 [http://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 51: | Line 51: | ||
<window title="My First ZK Spreadsheet Application" | <window title="My First ZK Spreadsheet Application" | ||
border="normal"> | border="normal"> | ||
− | <spreadsheet src="/WEB-INF/HelloZSS.xlsx" maxrows="100" | + | <spreadsheet src="/WEB-INF/HelloZSS.xlsx" maxrows="100" maxcolumns="100" width="50%" /> |
</window> | </window> | ||
</zk> | </zk> |
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 |
---|---|---|