Spring ME Supporting Namespaces?

11 Nov, 2009
Xebia Background Header Wave

It was actually quite a while ago since I looked at Spring ME, but then Davide Cerbo mentioned that he had presented Spring ME on Android at a Rome Spring meeting. Way cool! It triggered me thinking about the things that – according to the document I once wrote about it – were not implemented yet.

One of the things that I said was missing was support for namespaces. But is it really? Last week, I started to get some doubts. Maybe it was magically supported anyhow, and I just never bothered to give it a try.
Tonight I gave it a try. I have to admit that it didn’t work immediately, but that had more to do with the fact that Spring ME didn’t support FactoryBean and InitializingBean yet, and since I tested it on utils:constant, support for that turned out to be required. (FieldRetrievingFactoryBean implements both of these interfaces.) So, once I added support for FactoryBean and InitializingBean, it turned out to be working fine. Quite to my astonishment, I have to say.
So, in my test set up, this is my Spring configuration file:

<beans xmlns="..." xsi="..." util="..." schemalocation="...">

<bean id="person" class="me.springframework.sample.namespaces.Person">
<property name="age">
<util:constant field="java.lang.Integer.MAX_VALUE">


… and this is what Spring ME is generating:

org.springframework.beans.factory.config.FieldRetrievingFactoryBean result =
new org.springframework.beans.factory.config.FieldRetrievingFactoryBean();
return result.getObject();

How about that! Note that I am no defining the FieldRetrievingFactoryBean anywhere in my configuration file. That’s all based on Spring namespaces. Based on this, I get the feeling that this would basically work for any namespace, as long as the bean definitions generated by Spring are actually compatible with the subset of Spring currently supported by Spring ME.

Get in touch with us to learn more about the subject and related solutions

Explore related posts