Module Summary

David Winterfeldt

2008


Reusable libraries/modules released under the Apache License, Version 2.0 and developed with Java 5.

See Where is the Maven Repository for Spring by Example? for how to download or register the Maven repository for a Maven build or go to the download section of the related module.

1. Downloads

Custom ServletContext Scope Module

The Spring by Example Custom ServletContext Scope module is a custom scope implementation for providing ServletContext (web application) scoped beans.

Custom Thread Scope Module

The Spring by Example Custom Thread Scope module is a custom scope implementation for providing thread scoped beans.

[Note]Note

See org.springframework.context.support.SimpleThreadScope in Spring 3.0 for a Spring Framework implementation, but it doesn't support destruction callbacks (this implementation does when using a custom Runnable).

Dynamic Tiles Module

The Dynamic Tiles 2 module dynamically renders a Tiles 2 template with Spring MVC. Any request coming in mapped for Tiles processing will use the default template and dynamically insert the body based on the URL. There is support for AJAX and Spring Web Flow requests to render a fragment of a URL (based on AjaxTilesView from Spring JS and FlowAjaxTilesView from Spring Web Flow).

Spring by Example JCR Module

The Spring by Example JCR module uses Spring Modules JCR (Java Content Repository) module. Currently the utilities provide a way to recurse through the repositories nodes using JcrTemplate and a custom node callback for each matching node found while recursing the repository. This example uses Apache Jackrabbit for the Java Content Repository which is the reference implementation for JSR-170.

Spring by Example JDBC Module

The Spring by Example JDBC module has some utilities to help create and initialize a database. There is an extension of SimpleDriverDataSource from Spring, which doesn't pool connections (primarily for testing), that can be configured to run scripts once the class is initialized and another one based on Commons DBCP BasicDataSource. The script processor that they use can also be used separately.

[Note]Note

SimpleDriverDataSource was added to the Spring Framework in version 2.5.5, so 2.5.5 or higher is needed to use InitializingDriverManagerDataSource and HsqldbInitializingDriverManagerDataSource in Spring by Example JDBC version 1.0.4.

Spring by Example Utils Module

The Spring by Example Utils module currently has the HttpClientTemplate and HttpClientOxmTemplate which are light wrappers on top of Apache's HttpClient providing Spring style code based templating. The latter template provides marshaling and unmarshalling of XML based requests.

Built on top of the HttpClientTemplate and HttpClientOxmTemplate, the SolrOxmClient provides for easier client communication with Apache Solr. Solr provides an XML based API over HTTP to the Apache Lucene search engine. SolrOxmClient marshalls/unmarshalls searches and updates to and from a JavaBean. It also allows calls to commit, rollback, and optimize.

The Logger BeanPostProcessor provides logger creation and injection based on reflection, interfaces, or annotations.

The ImageProcessor is a utility to process images and currently can help scale and image from one size to another either using a java.io.File or a java.io.InputStream to a java.io.OututStream.

Spring by Example Web Module

There is a Spring GWT Controller for standard GWT usage and also Spring Bayeux integration for using Comet on Jetty.

There is an ImageInterceptor that intercepts a request and looks in a directory that matches the requests relative path. Currently it only matches one image extension type which defaults to '.jpg'. It generates a thumbnail if one doesn't exist and also makes a list of available thumbnails and images.