Java AJAX开发系列 - 2,项目中使用ZK

开发环境 Zk Studio

ZK Studio插件

image

Pom.xml

<repositories> 添加ZK的仓库地址

<repository>

<id>zk repository</id>

<url>http://mavensync.zkoss.org/maven2</url>

</repository>

其中的依赖项设置

<!-- ZK -->

<dependency>

<groupId>commons-logging</groupId>

<artifactId>commons-logging</artifactId>

<version>1.1.1</version>

</dependency>

<dependency>

<groupId>commons-io</groupId>

<artifactId>commons-io</artifactId>

<version>1.3.1</version>

</dependency>

<dependency>

<groupId>commons-lang</groupId>

<artifactId>commons-lang</artifactId>

<version>2.4</version>

</dependency>

<dependency>

<groupId>org.zkoss.theme</groupId>

<artifactId>breeze</artifactId>

<version>5.0.7.1</version>

</dependency>

<dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zul</artifactId>

<version>5.0.7.1</version>

</dependency>

<dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zkplus</artifactId>

<version>5.0.7.1</version>

</dependency>

<dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zhtml</artifactId>

<version>5.0.7.1</version>

</dependency>

<dependency>

<groupId>org.zkoss.common</groupId>

<artifactId>zweb</artifactId>

<version>5.0.7.1</version>

</dependency>

<dependency>

<groupId>org.zkoss.common</groupId>

<artifactId>zcommon</artifactId>

<version>5.0.7.1</version>

</dependency>

<dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zuljsp</artifactId>

<version>1.5</version>

</dependency>

<dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zkplus</artifactId>

<version>5.0.7.1</version>

</dependency>

<!--

  <dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zml</artifactId>

<version>3.6.4</version>

</dependency>

-->

<dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zul</artifactId>

<version>5.0.7.1</version>

</dependency>

<dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zkspring-core</artifactId>

<version>3.0</version>

</dependency>

<dependency>

<groupId>org.zkoss.zk</groupId>

<artifactId>zkspring-security</artifactId>

<version>3.0</version>

</dependency>

<dependency>

<groupId>org.zkoss.zkforge.el</groupId>

<artifactId>zcommons-el</artifactId>

<version>1.1.0</version>

</dependency>

<dependency>

<groupId>org.beanshell</groupId>

<artifactId>bsh</artifactId>

<version>2.0b4</version>

</dependency>

<!-- ZK's End -->

Web.xml

<servlet>

<servlet-name>zkLoader</servlet-name>

<servlet-class>

org.zkoss.zk.ui.http.DHtmlLayoutServlet

</servlet-class>

<init-param>

<param-name>update-uri</param-name>

<param-value>/zkau</param-value>

</init-param>

<load-on-startup>1</load-on-startup>

</servlet>

<listener>

<description>Used to cleanup when a session is destroyed</description>

<display-name>ZK Session Cleaner</display-name>

<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>

</listener>

<servlet>

<servlet-name>auEngine</servlet-name>

<servlet-class>

org.zkoss.zk.au.http.DHtmlUpdateServlet

</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>zkLoader</servlet-name>

<url-pattern>*.zul</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>zkLoader</servlet-name>

<url-pattern>*.zhtml</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>auEngine</servlet-name>

<url-pattern>/zkau/*</url-pattern>

</servlet-mapping>

 

如上配置完成后,即可在项目使用ZK的功能,上面的Maven配置包括了常用的ZK的各个组件。

 

posted @ 2011-09-06 08:31  2012  阅读(1319)  评论(0编辑  收藏  举报