Spring Framework

annotations

How to inject properties file using Java annotations??

Create the properties file. e.g. "fortunes.properties"
 
create key, value pairs e.g.
fortunes.one="Good Day"
fortunes.two="Well Played"
 
Build a reference to the properties file in the applicationContext.xml Configuration file
 
@Value(value = "${fortunes.one}")
private String firstValue;

Diskussion