That old Spring magic has me in its SpEL: DI Wizardy with the Spring Expression Language

Spring 3.0 introduced the Spring Expression Language (SpEL), an extremely powerful yet succinct way to wire non-trivial values into Spring beans. In this presentation, we'll explore SpEL in great detail and see how SpEL opens up a whole new realm of bean wiring possibilities.

Spring's brand of dependency injection is quite awesome. But there are times when simple bean references and static values won't cut it. Sometimes it makes more sense to wire bean properties with values that are evaluated dynamically at runtime.

That's where the Spring Expression Language (SpEL) comes in. SpEL is one of the most interesting of the many new features in Spring 3.0. With SpEL you can succinctly wire in values derived...

  • ...from system properties
  • ...mathematically
  • ...from the values of other bean properties
  • ...from the results of static methods
  • ...from almost anything you can conjure up

Previously, most of these types of wiring could only be accomplished with more XML configuration or special helper factory beans. But with SpEL, the seemingly impossible is not only possible, but is quite easy.

In this example-driven presentation, we'll explore SpEL in detail and you'll learn the tricks of SpEL that will make you a bean wiring wizard.


About Craig Walls

Craig Walls

Craig Walls has been professionally developing software for over 17 years (and longer than that for the pure geekiness of it). He is a senior engineer with SpringSource as the Spring Social project lead and is the author of Spring in Action and XDoclet in Action (both published by Manning) and Modular Java (published by Pragmatic Bookshelf). He's a zealous promoter of the Spring Framework, speaking frequently at local user groups and conferences and writing about Spring and OSGi on his blog. When he's not slinging code, Craig spends as much time as he can with his wife, two daughters, 4 birds and 3 dogs.

More About Craig »