论坛首页 Web前端技术论坛

ZK开发环境快速配置

浏览 15384 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-05-26   最后修改:2009-05-26

以下内容全部来自ZKQuickStart Guide(写的不好,大家就当学习英文吧。)
如果不清楚的可以直接看ZK官方的QuickStart Guide
http://docs.zkoss.org/wiki/QuickStart_Guide
第一步:准备环境运行ZK(Preparing an environment to run ZK)

    先决条件(Prerequisites)

        如果你没有安装以下软件,请先下载了再说吧(If you haven't installed the following applications on your computer, please download and install them first. )  

        Java SE Development Kit (JDK)

        Application Server

        ZK Library   

        ZK Studio

        Eclipse

            JDK,Eclipse和服务器就不说了啥,服务器就用Tomcat吧

 

            ZK Library可以在http://www.zkoss.org/download/zk.dsp这里下载

            ZK Studio插件可以在http://www.zkoss.org/product/zkstudio.dsp这里下载,并安装到Eclipse上

 

第二步,配置ZK库(Configuring the ZK Library )

        1.打开Eclipse(前提条件是已经安装好了ZK studio插件)Start an Eclipse installation which already contains ZK Studio.

        2.点击菜单Window->Preferences(From menu goto Windows > Preferences )

        3.在打开的这个窗口上选择ZK->ZK Packages(On the Preferences Window, select ZK > ZK Packages)

        4.点击Add Diretory 选择到你下载的ZK Library包,不用解压,直接是ZIP文件(If you have extracted the ZK library please click Add Directory and select the location where you extracted file, then click OK; Otherwise click Add File and select the ZK Package zip file. )如下图

       

 

 5.会跳出一个窗口来,点击OK

 6.让你给这个包命个名,就用默认的吧,点击OK(Name the imported package and then click OK)

 

7.再选择上那个ZK Library就行了,如果你不选择,会自动选择最后你引入的版本的(ZK Studio will now import the selected ZK Library,If you don't select a default ZK library, ZK Studio will automatically choose the latest version of your imported ZK Packages. )

好了,就这样,ZK的环境就配置完了

 

官方还提供了丰富的例子程序,在线看:http://www.zkoss.org/zkdemo/userguide

下载运行:http://prdownloads.sourceforge.net/zk1/zk-demo-3.6.0.zip?download

 

第三步:用Eclipse创建ZK项目(Creating a "hello world" application from scratch (with an IDE) )

1.创建Dynamic web Project(Creating a new "Dynamic Web Project")

1.选择File->New->Dynamic Web Project,如果没有就选Others,再勾上Show All Wizards(Click File > New > Dynamic Web Project in Eclipse main menu)

 2.我这里和官方的不一样,再点Next,加入ZK Supports,再点Finish就完成了一个项目的创建

第四步:创建一个新的ZUL文件(Creating a new ZUL file)

这个就像建立JSP文件一样的

第五步:流行ZUL文件(Running the ZUL file)

1. Right click on the MyApps project in explorer and in the Menu dialog select Run As > Run on Server (右键项目,选择Run AS -> Run on Server)
2. Select Apache > Tomcat v6.0 Server in server type dialog and then click Finish (选好服务器,点Finish就行了)
3. See the result in your browser. (在你的Browser里面查看)

 

  • 大小: 77.3 KB
  • 大小: 19.9 KB
  • 大小: 17.8 KB
  • 大小: 74.8 KB
  • 大小: 55.7 KB
   发表时间:2009-05-27  
问一个问题 ,ZK在开发 中用的多吗?
很少听到别人 讨论这个.....疑惑?
0 请登录后投票
   发表时间:2009-05-28  
makemyownlife 写道
问一个问题 ,ZK在开发 中用的多吗?
很少听到别人 讨论这个.....疑惑?

我在网上看到有人希望这个框架火起来,我也希望,不过感觉火不起来啊。。这个不用写JAVASCRIPT代码的,不过JAVA代理都写到页面上,真还不如直接写JSP,关键看自己的想法了。。。用的不多
0 请登录后投票
   发表时间:2009-06-07  
ZK感觉上实际项目中用不上。
0 请登录后投票
   发表时间:2009-06-08  
ZK有自己的特色,有自己的标签库,有自己的语言
但是从用户体验来说,和ExtJS还有一定的差距
0 请登录后投票
   发表时间:2009-06-30  
哎,好像Myeclipse上也没有Dynamic xxxProject这一项啊!
难道真要装回eclipse
1 请登录后投票
   发表时间:2009-06-30  
天机老人 写道
哎,好像Myeclipse上也没有Dynamic xxxProject这一项啊!
难道真要装回eclipse

有的,你把Show ALL Wizards点上就有了
0 请登录后投票
   发表时间:2009-11-24  
Actually, ZK not suggest to write code on the zul page, should use MVC approach, zul just for view, model and control should be separate to java file, however, it has ability to allow you write control code on zul page, just like jsp, you can write code on it or separate, depends on you, not the ZK framework.
0 请登录后投票
   发表时间:2010-03-01  
楼上正解啊
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics