Sample-spring-basic » History » Revision 14
« Previous |
Revision 14/33
(diff)
| Next »
Henning Blohm, 14.09.2012 12:17
A basic Spring with Z2 modularity sample¶
The sample contained in the repository z2-samples.spring-basic is a clean room example on how to use the Spring integration features described in how_to_spring.
There is no further pre-requisite to running this sample, and you may proceed as described in How to run a sample. Here's the really fast version:
mkdir install
cd install
git clone -b master http://git.z2-environment.net/z2-base.core
git clone -b master http://git.z2-environment.net/z2-samples.spring-basic
# on Linux / Mac OS:
cd z2-base.core/run/bin
./gui.sh
# on Windows:
cd z2-base.core\run\bin
gui.bat
If you want to inspect the code using Eclipse, please create a workspace in install (i.e. install/workspace) and import the Git repositories and projects (see also First steps.
There are two modules contained in this sample:
com.zfabrik.samples.spring-basic.services¶
This module has a classpath defined applicationContext and exposes an annotation defined bean ComputationServiceImpl bean from it as a service to be consumed from another module: The computations bean.
com.zfabrik.samples.spring-basic.frontend¶
This module has a Web application with an application context defined in WEB-INF/applicationContext. It uses Spring AspectJ based annotation driven configuration to inject dependencies into instances of ControllerServlet.
It's application context imports the computations service from the other module above.
Finally¶
Open a browser and navigate to http://localhost:8080/frontend to verify you get this:
Updated by Henning Blohm over 12 years ago · 14 revisions