Spring Expression Language - a Spring 3 Feature You May Be Forgetting? - Intertech Blog
Spring Expression Language (SpEL) was one of the new features that debuted with Spring 3.0. Spring 3.0 was released back in December 2009. So that makes this feature a little less than four years old as of this writing. Yet, in my informal survey of teams using Spring, I am always a bit surprised at how few applications are taking advantage of this powerful feature today. So in this post, I'd like to provide a quick tutorial on SpEL and highlight a few places I think SpEL can help in your project.
The Syntax
First off, SpEL can be used in both XML and annotation metadata (also known as Spring configuration or wiring). In either case, the syntax to designate a Spring expression for evaluation at runtime is #{ "SpEL expression string"}. Here is a simple example of using SpEL in XML to provide default values to an Address bean:
Read full article from Spring Expression Language - a Spring 3 Feature You May Be Forgetting? - Intertech Blog
No comments:
Post a Comment