天天看點

Java AJAX開發系列 - 2,項目中使用ZK

ZK Studio插件

Java AJAX開發系列 - 2,項目中使用ZK

<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>

<groupId>commons-io</groupId>

<artifactId>commons-io</artifactId>

<version>1.3.1</version>

<groupId>commons-lang</groupId>

<artifactId>commons-lang</artifactId>

<version>2.4</version>

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

<artifactId>breeze</artifactId>

<version>5.0.7.1</version>

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

<artifactId>zul</artifactId>

<artifactId>zkplus</artifactId>

<artifactId>zhtml</artifactId>

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

<artifactId>zweb</artifactId>

<artifactId>zcommon</artifactId>

<artifactId>zuljsp</artifactId>

<version>1.5</version>

<!--

  <dependency>

<artifactId>zml</artifactId>

<version>3.6.4</version>

-->

<artifactId>zkspring-core</artifactId>

<version>3.0</version>

<artifactId>zkspring-security</artifactId>

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

<artifactId>zcommons-el</artifactId>

<version>1.1.0</version>

<groupId>org.beanshell</groupId>

<artifactId>bsh</artifactId>

<version>2.0b4</version>

<!-- ZK's End -->

<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-name>auEngine</servlet-name>

org.zkoss.zk.au.http.DHtmlUpdateServlet

<servlet-mapping>

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

</servlet-mapping>

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

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

如上配置完成後,即可在項目使用ZK的功能,上面的Maven配置包括了常用的ZK的各個元件。