By Markus Sprunck; Revision: 1.2; Status: final; Last Content Change: Apr 28, 2013;
This article describes a minimal standalone spring application on Spring 2.5.6 Framework. To start with Spring-Framework it is not necessary to use all parts of the framework and/or to work with a web application. The Spring-Framework can also used for small standalone applications. You need just some minutes setup your own application.
In this tutorial Spring 2.5 with a pure XML configuration is described. The use of annotations is described in the article A Minimal Java Application Sample Based on Spring 3.1 Framework.
// File #1: MinimalSpringApp.java
// File #2: application-config.xml
// File #3: IFoo.java
// File #4: Foo.java
If you run this small program, you should see something like this:
To bring all the files together, the following 4 libraries:
are needed in the build path.
Figure 1: Overview of the project in Eclipse