Visit our blog
News & Events
This Week in Spring - April 3rd, 2012
Welcome to another Installment of This Week in Spring
The Cloud Foundry Open Tour is well underway, and have been thus far very good events to attract community.
There are still some (well, there were yesterday!) early bird spots in the upcoming shows in Austin, Washington D.C., Kiev, Moscow, and London, so book now.
- Some of the wonderful content from the Spring I/O conference is now available online! The conference, held in Spain in February of this year, is conducted in both Spanish and English, so there's a lot to like no matter which language you speak. Adrian Colyer's keynote session is super, once you get past the audio problems at the beginning. I couldn't find a SpringIO-specific hash tag, but you can pick them out of the other videos pretty easily by scrolling down. Stay tuned, there should be even more content posted, soon.
- Tobias Fiohre (who seemingly lives only to please us, the lucky developers in the Spring community!) has put up the third installment of his blogs on Spring Batch and transactions.
The first one introduced the basics, and the second one introduced restart and cursor-based readers and writers.
- The Cake Solutions gang has two wonderful posts on the nuances of using Spring Data Neo4j from Scala. Confusingly, there is a subsequent blog, called Spring Data Neo4j and MongoDB which has more to do with how to write a domain model using the Spring Data Neo4J and MongoDB annotations together, in Scala, than on how to actually use Spring Data MongoDB. But, knowing them, I trust that just means we'll have something wonderful to look forward to next week!
- The NovoJ blog has a great look at composing custom security annotations in Spring Security with a bit of help.
- I've had a few people ask me how to modularly turn on runtime features exposed as aspects in Spring. The answer's usually to conditionally enable or disable the feature at the proxy or aspect level, as described in this StackOverflow post. For extra points, you might wire that property up to JMX so that it can be easily changed from an operations console.
Blogger Eren has an interesting post explaining how to integrate JSF 2.1, Hibernate 4.1.0, Primefaces 3.1.1, Tomcat 7.0, and Spring 3.1.1. It's got a lot of the moving parts correctly lined up, which is nice, and a testament to how far Spring can take you. But, I would suggest a few updates: first, you can use Spring to manage your JSF beans with the
SpringBeanFacesELResolver, making them fully managed components in Spring, and giving them access to all the benefits other Spring components benefit from.
Additionally, I'd probably use Java-style configuration, and avoid the extra layering imposed by having a DAO and a Service, which essentially just delegates to the DAO. These are, of course, just a matter of taste. Either way, good post!
- The VoltDB blog has a fantastic post on how to integrate VoltDB - an in-memory distributed database - with the Spring framework. The blog sketches the outlines of a simple Spring integration. I'd recommend wrapping up the client creation login in a
FactoryBean, which would let people inject the
Client directly. That said, this is a cool look at a cool technology.
- The Java Revisited blog has a great look at how to limit the number of sessions in an application from Spring Security, which is the first point of entry in secured Spring applications.
- The Safari books blog has an interesting tip about using JSON views from Spring MVC controllers. The tip is over-specific, however. If you're using Spring MVC 3, or Spring 3.1, you don't need to actually use that configuration. You can simply setup a simple Spring MVC
@Controller class with a method annotated with
@ResponseBody on the return type and - assuming your requests have an
Accept header (
Accept: application/json) in the request, and that you have Jackson (for JSON), or JAXB (for XML) on the class path - then the response will be a JSON response.
- Blogger Duck Ranger has an amazing post on the nitty gritty of what the Spring
DispatcherServlet does as the core of Spring's web machinery. Great post, and worth a read. So is her previous post introducing Spring Source Tool Suite, from last year.
- Blogger Tomasz Nurkiewicz has a great post that explains how to setup a
JDBCJobStore with Spring and Quartz, the job scheduling engine.
- The Java Code Geeks blog has a great roundup of the various remoting technologies supported by Spring, including RMI, the HTTP Invoker, Hessian, Burlap, JAX-WS, JMS, and JAX-RPC complete with example RMI code.
Developers who like the remoting hierarchies in Spring core might also be interested in my repository on GitHub that I created several months ago to demonstrate how to provide Spring
ServiceExporter and marshalling
HttpMessageConverter (so that you can use these marshalling technologies with Spring MVC's REST support) implementations for Avro, Thrift, MessagePack, and Google Protocol Buffers, among others.
- Using Java FX? You'll need to secure it to do anything useful in a large deployment. The ZenJava explains how to use Spring Security to secure your Java FX applications.
Our monthly newsletter is packed full of techniques, tutorials, tips and tricks to get you on your way to Spring nirvana. View Archive