A spring 2.5 approach:
@Component
public class Foo {
@Autowired
@Qualifier("myFlag")
private Boolean flag;
}
and context
<context:component-scan base-package="..."/>
<context:property-placeholder location="classpath:app.properties"/>
<bean id="myFlag" class="java.lang.Boolean">
<constructor-arg value="${foo.bar}"/>
</bean>
Greetings
source
share