Page 1 of 1

Inject run-time properties value to bean using annotation

Posted: Fri Jul 17, 2015 2:54 am
by tonystt
Hi all,

Say I have a bean likes below
public class A{

public fieldA;
}

How can I inject value of a property stored in properties file such as developement.properties using Spring annotation injection?

Thanks,
Tony

Re: Inject run-time properties value to bean using annotation

Posted: Mon Jul 27, 2015 4:49 am
by phillipuniverse

Code: Select all

public class A {
    @Value("my.property")
    public fieldA;

}