Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Introducing Expression Language Support [SPR-4] #4739
Mike's been talking about introducing OGNL support. Seems like a nice idea to me, though not really feasible for the 1.0 release I think. But hey, let's put it in here so we won't forget...
Mike's mail (December 2nd):
Or an even better idea... how about supporting OGNL within the Spring config files? (like Xwork does)
This would be awesome and I just found a second use case for it (the very minute Rob's email came in).
My use case - Maps.
The Map syntax is nice, but not very useful in practicality I'm finding as the key and value of the map are usually related, for instance I often want to put a list of referenced beans into a map, with ref.getName() (or some
At the moment I have to add a setBeans(List) method to my class, and then in that setter iterate and add to a map - smelly!
If we allowed OGNL expressions, it would be very simple to do this in the config file itself:
I'm sure there are a million other places where OGNL would be useful too, but AFAIK the above can't be done without it?
Or have I just been at this desk far too long?
Affects: 1.0 M4
Referenced from: commits spring-projects/spring-integration@e571034
8 votes, 6 watchers
Matthew Payne commented
Seems to go hand and hand with the validator support feature meantioned in RC 1.1.
Guillaume Poirier commented
I sent this patch to the dev list before, but I figure I should upload it to JIRA so that it doesn't get lost. The patch has been made against an earlier CVS snapshot, but it seems to still work against the latest version. It does not include the modifications discussed on the mailling list though, such as using <expr type="ognl"> instead of <ognl>. If my contribution is accepted and we can agreed on the syntax, then I'll complete it to include such changes.
Rob Harrop commented
I'm moving his to the 2.1 timeframe and renaming it. We do want to include expression language support, but since OGNL is no longer actively maintained (last release was August 2004) we will be evaluating other areas. One are that we are working in is common EL across Java and .NET.