java – I want to read spring properties file that has a map of maps

java – I want to read spring properties file that has a map of maps

I found the way, I had to just remove the after the key

propertymap = {  
   key1:{  
      subkey1:subvalue1,
      subkey2:subvalue2
   },
   key2:{  
      subkey3:subvalue3,
      subkey4:subvalue4
   }
}

and below code picks it up

@Value(#{${propertymap}})  
private Map<String,Map<String,String>> propertymap;

java – I want to read spring properties file that has a map of maps

Leave a Reply

Your email address will not be published. Required fields are marked *