Setting Up ZK Spring using Maven
From Documentation
Revision as of 09:52, 6 June 2012 by Hawk (talk | contribs) (→Adding ZK Spring library dependencies: remove jboss.el , zk version with zkspring version)
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
Version | Date | Content |
---|---|---|