Reputation: 582
I was planning to use @Value
annotation to my service implementation class.
@Value("${some_property:default_value}")
private String key;
To use above annotation, I can use @Autowired
annotation.
@Autowird
Private Environment environment;
But, I am planning to use those setting in my applicationContext.xml
file, which is something like following below.
<context: something missing here = "ENVIRONMENT"/>
Upvotes: 2
Views: 113
Reputation: 4509
Yes. You can do it in applicationContext.xml
beans
tag itself there is a property called profile
So you can do profile="ENVIRONMENT"
in latest spring version.
Upvotes: 1