Setting Up ZK Spring using Maven"

From Documentation
Line 23: Line 23:
 
==== Adding ZK Spring library dependencies  ====
 
==== Adding ZK Spring library dependencies  ====
  
You can declare these dependencies in pom.xml file and Maven can resolve them by automatically connecting to [http://mavensync.zkoss.org/maven2 ZK Maven repository] Here is how you can declare a dependency for ZK Spring library for your project.
+
You can declare these dependencies in pom.xml file and Maven can resolve them by automatically connecting to [http://mavensync.zkoss.org/maven2 ZK Maven repository] Below shows how you can declare a dependency for ZK Spring library for your project.
  
 
<source lang="xml">
 
<source lang="xml">

Revision as of 02:08, 18 November 2011

Setting Up ZK Spring using Maven



Subsections:


Purpose

Setup ZK Spring Integration Library using maven configurations

Example

Add ZK Maven repository to your pom.xml file

By default, while resolving project dependencies Maven will only look into Maven central repository [1]. In order to use ZK Maven repository, add the following <repositories> elements into pom.xml under the root <project> element.

 <repositories>
    <repository>
      <id>zk repository</id>
      <url>http://mavensync.zkoss.org/maven2</url>
    </repository>
  </repositories>

Note that ZK Maven repository URL is http://mavensync.zkoss.org/maven2.

Adding ZK Spring library dependencies

You can declare these dependencies in pom.xml file and Maven can resolve them by automatically connecting to ZK Maven repository Below shows how you can declare a dependency for ZK Spring library for your project.

<dependency>
	<groupId>org.zkoss.zk</groupId>
	<artifactId>zkspring-core</artifactId>
	<version>3.0</version>
</dependency>
<dependency>
	<groupId>org.zkoss.zk</groupId>
	<artifactId>zkspring-webflow</artifactId>
	<version>3.0</version>
</dependency>
<dependency> 
	<groupId>org.jboss.el</groupId>
	<artifactId>com.springsource.org.jboss.el</artifactId> 
	<version>2.0.0.GA</version> 
</dependency>

Configuration

  • You need to declare Spring ContextLoaderListener in the web.xml file to be able to declare and register your Spring beans with Spring framework.
<listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

Version History

Last Update : 2011/11/18


Version Date Content
     


Last Update : 2011/11/18

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.