1. Define your properties in a properties file
2. Ensure that you have your context property placeholder defined in your context xml
3. Finally in your java class, you can inject the value when you define the class member:
gestures=rock, paper, scissors, lizard, spock
2. Ensure that you have your context property placeholder defined in your context xml
<context:property-placeholder location="classpath*:*.properties"/>
3. Finally in your java class, you can inject the value when you define the class member:
@Value("#{'${gestures}'.split(',')}") private List<String> gameGestures;
thanks, it's working
ReplyDeleteGood :)
DeleteGlad it helped :)
ReplyDelete