I am trying to get map from my properties file, which goes as below:
Mapping = { "NAME-1":"AAA,aa,bb" , "NAME-2":"BBB,bb,cc" }
In My class file, I am doing this
@Value("${Mapping}")
private String mapping;
@Bean
public Map<String,String> getMapping() {
log.debug("inside mapping");
Map<String,String> mapping = new HashMap<String,String>();
return mapping;
}
Which is not working, please help.
config.properties
? Are you trying to create ajava.util.Map
from the contents of that file?