tags:

views:

160

answers:

1

Using Spring 3.0 EL can we auto wire a property from a property file to a component?

I know we can load a properties file using Util namespace and we can access it as a bean, but can we autowire using spring EL.

<util:properties id="myProperties" location="/WEB-INF/my.properties"/>

+2  A: 
@Value("#{ myProperties['min.age.required'] }")
int age;

By the way, good old <context:property-placeholder .../> works fine too:

@Value("${min.age.required}")
int age;
axtavt