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 dm Server Simple Spring MVC | This is an application with a simple form for creating and editing a Person. There is a PAR bundle which has a DataSource bundle, Person DAO bundle using JPA, and a web module using Spring MVC annotations, Tiles, and internationalization. It was made to be deployed on the Spring dm Server in the Eclipse IDE. |
| Spring dm Server Simple Message Service | There are three OSGi bundles in this example. Two are different versions of a bundle that exposes a message interface as an OSGi service. Each bundle depends on a different version of Commons Lang to demonstrate the side-by-side versioning capabilities of OSGi. The third bundle is a web module that displays the result from calling the OSGi message service. The example was made to be deployed on the Spring dm Server. |
| Spring Bayeux GWT Trade Monitor Webapp | The Trade Monitor has a client that allows dynamic subscriptions to trade summary information for a stock symbol. The data is random buys and sells generated on the server by a timer. The example has GWT & Dojo Cometd integration on the client and Spring Bayeux integration on the server. The GWT part of the client handles display and client interaction, but calls out to external JavaScript to let Dojo Cometd handle Bayeux publish/subscribe on the client. The Spring by Example Web Module is used for it's Bayeux support to configure the Bayeux Trade Monitor Service. |
| Spring Bayeux GWT Chat Webapp | The chat example allows a client to send and receive messages published to a chat channel and also to see a list of the other chat clients. The example has GWT & Dojo Cometd integration on the client and Spring Bayeux integration on the server. The GWT part of the client handles display and client interaction, but calls out to external JavaScript to let Dojo Cometd handle Bayeux publish/subscribe on the client. The Spring by Example Web Module is used for it's Bayeux support to configure the Bayeux Chat Service. |
| 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. |
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.