Setting Up ZK Spring using Maven"

From Documentation
(→‎Adding ZK Spring library dependencies: remove jboss.el , zk version with zkspring version)
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] Below shows how you can declare a dependency for ZK Spring library for your project.
+
Add the following dependencies and Maven can resolve them by connecting to [http://mavensync.zkoss.org/maven2 ZK Maven repository].
  
 +
For ZK '''5''', you can use '''3.0''' or '''3.1'''.
 +
 +
For ZK '''6''', you should use '''3.1'''.
 +
 +
'''ZK Spring Core''''
 
<source lang="xml">
 
<source lang="xml">
 +
 
<dependency>
 
<dependency>
 
<groupId>org.zkoss.zk</groupId>
 
<groupId>org.zkoss.zk</groupId>
 
<artifactId>zkspring-core</artifactId>
 
<artifactId>zkspring-core</artifactId>
<version>3.0</version>
+
<version>3.1</version>
 
</dependency>
 
</dependency>
 +
 +
</source>
 +
 +
You can add zkspring-webflow or zkspring-security according to your requirement.
 +
 +
'''ZK Spring Webflow'''
 +
<source lang="xml">
 
<dependency>
 
<dependency>
 
<groupId>org.zkoss.zk</groupId>
 
<groupId>org.zkoss.zk</groupId>
 
<artifactId>zkspring-webflow</artifactId>
 
<artifactId>zkspring-webflow</artifactId>
<version>3.0</version>
+
<version>3.1</version>
 
</dependency>
 
</dependency>
<dependency>  
+
 
<groupId>org.jboss.el</groupId>
+
</source>
<artifactId>com.springsource.org.jboss.el</artifactId>  
+
 
<version>2.0.0.GA</version>  
+
'''ZK Spring Security'''
 +
<source lang="xml">
 +
<dependency>
 +
<groupId>org.zkoss.zk</groupId>
 +
<artifactId>zkspring-security</artifactId>
 +
<version>3.1</version>
 
</dependency>
 
</dependency>
 +
 
</source>
 
</source>
  

Revision as of 09:52, 6 June 2012

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

Add the following dependencies and Maven can resolve them by connecting to ZK Maven repository.

For ZK 5, you can use 3.0 or 3.1.

For ZK 6, you should use 3.1.

ZK Spring Core'

<dependency>
	<groupId>org.zkoss.zk</groupId>
	<artifactId>zkspring-core</artifactId>
	<version>3.1</version>
</dependency>

You can add zkspring-webflow or zkspring-security according to your requirement.

ZK Spring Webflow

<dependency>
	<groupId>org.zkoss.zk</groupId>
	<artifactId>zkspring-webflow</artifactId>
	<version>3.1</version>
</dependency>

ZK Spring Security

<dependency>
	<groupId>org.zkoss.zk</groupId>
	<artifactId>zkspring-security</artifactId>
	<version>3.1</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 : 2012/06/06


Version Date Content
     


Last Update : 2012/06/06

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