Welcome
Welcome to Spring by Example. This site is for helping Spring developers collaborate by sharing Spring configuration and code examples. Any code contributed should be owned by the contributer and have the rights to release the contribution under an Open Source License.
Note: As an update to the site, most of the examples are now being provided as static HTML pages with improved formatting by following the examples link, but the TWiki is still available for user contributions.
Most Recent Examples
| Topic | Description |
|---|---|
| Spring by Example Web Module | The Spring by Example Web module has added a Spring GWT Controller for standard GWT usage and also Spring Bayeux integration for using Comet on Jetty. |
| Spring by Example Custom ServletContext Scope Module | The Spring by Example Custom ServletContext Scope module is a custom scope implementation for providing ServletContext (web application) scoped beans. |
| Spring Modules with Commons Configuration | Spring Modules Jakarta Commons example loading properties from a database. This example will show you how to use a DatabaseConfiguration from the Jakarta Commons Configurations project to load the Database Properties into your application context. |
| Simple Spring Web Services | A very simple example of using Spring Web Services 1.5.x with JAXB for marshalling and unmarshalling requests. A JAXB plugin for Maven is used to generate the JAXB beans from and XSD and the XSD is reused to generate a WSDL. The response from the server sends a person list, but could easily be modified to retrieve person based on an ID. |
| Simple GWT Spring Webapp | This enhances the Spring Web Flow Subflow Webapp by using GWT (Google Web Toolkit) version 1.5-RC1 for a GWT table widget on the search page. The example also uses Spring JS to submit the person form by using Spring.remoting.submitForm to only update the content div. Dynamic Tiles 2 Spring MVC Module (version 1.1) has been updated to support rendering Tiles fragments like AjaxTilesView and FlowAjaxTilesView in Spring JS and Spring Web Flow. |
Spring In-depth, In Context
Spring In-depth, In Context is a free online book for Spring 2.5. It is a work in progress, but there is already a lot of material. It currently has a very good introduction to Spring, basic bean creation using XML and Annotations. Although the Annotations chapter isn't 100% complete. There are also partially complete chapters on Resources & ApplicationContexts and AOP.- Preface
- Chapter 1: Spring In Context: Core Concepts
- Chapter 2: A Practical Introduction to Inversion of Control
- Chapter 3: In-depth Inversion of Control (IoC) [Draft]
- Chapter 4: Annotation-based Bean Configuration [Draft]
- Chapter 5: Bean & Resource Loading [Draft]
- Chapter 6: AOP [Draft]
How to Contribute
If you have a Spring example that you've worked on and feel it would be useful to share it with others, please contribute it to the site by posting an example in the TWiki.