Sunday, December 14, 2008

Spring by Example Update (0.95-0.97)

In these updates, three new examples were added (links below), there were some miscellaneous typos fixed, and also the Simple Spring Web Services using JAXB for Marshalling was updated to use non-deprecated dynamic WSDL generation classes and to use the JAXB Fluent API (which is less verbose than the standard one).

Thursday, November 20, 2008

Spring by Example Update (0.94)

There isn't any change in the content, but the URLs generated aren't numbered anymore. Before if an article was inserted, it would bump all the other numbers up. Now the example articles will be easy to bookmark through a symlink from version to version as they're updated. So instead of '/static/0.93/html/ar21.html' for Dynamic Tiles 2 Spring MVC Module the url is now '/static/0.94/html/dynamic-tiles-spring-mvc-module.html' or through the symlink to the latest version it's '/static/examples/html/dynamic-tiles-spring-mvc-module.html'.

Tuesday, November 18, 2008

Spring by Example Update (0.93)

The site's static examples have just been updated to version 0.93. It's mainly some minor updates correcting errors again. A note was added about classloading issues when using the custom ServletContext scope. Also, Barry M. pointed out that the Dynamic Tiles 2 Spring MVC Module had a typo for the tilesBodyAttributeName default value. It said 'body' instead of 'content'. Thank you Barry!


Sunday, October 26, 2008

Spring by Example Web Module GWT & Comet Support

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.

Wednesday, October 22, 2008

Spring by Example RSS Feed

The Spring by Example RSS feed has been updated to a new url, which is http://www.springbyexample.org/feed/. Before the feed was generated by the TWiki so it wasn't also including the static examples.

Spring by Example Update

The site's static examples have just been updated to version 0.91. It's mainly some minor updates correcting errors, adding a setup appendix that is more detailed than the old setup, and updating the articles to point to the new setup appendix. Also a new custom scope module for the ServletContext has been added.

Custom ServletContext Scope Module

A new module has just been posted. It's a custom scope for a ServletContext. Typically a Spring singleton would be adequate for a single application, but this could be used to share a bean across multiple web applications if the servlet container has cross context support.


<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
<property name="scopes">
<map>
<entry key="servletContext">
<bean class="org.springbyexample.web.context.ServletContextScope" />
<property name="context" value="/advanced-form" />
</bean>
</entry>
</map>
</property>
</bean>

Saturday, October 11, 2008

Commons Configuration with Spring Modules

DanielP has kindly posted an example on how to use Commons Configuration with Spring Modules for loading properties from a database and using them in your Spring Configuration. Thank you DanielP.

Spring by Example

Spring by Example was started at the beginning of 2008 and now has over 25 examples. I've been writing about it in my blog Spring, Java, and other Fun Stuff. I decided to start a separate blog to link to from examples to have any user discussions take place here, and use my blog to talk more about anything I've been doing. Below is the original announcement on my blog from March 7th, 2008 with the links updated to point to the new static format instead of to the TWiki.

The Spring by Example site is finally open! I've been working this for a couple of months, but wanted it to be fairly nice when it went live. It has a few good examples and I have more to post. A few people I know have said they will contribute examples as they have time also. These are some of my favorite examples posted so far.


Tim Voet also posted an example using a BeanPostProcessor to dynamically insert a logger based on the bean's class if it has a setLogger method. This is a nice way to avoid typos when creating loggers.