2017-03-21 167 views
0

我使用的是春天的引导框架图在application.properties文件的列表中,是否有可能在appllication.properties文件中定义的HashMap结构的列表,并使用该名单在我的Java类。这里是prorperties文件中的示例结构。定义在春季启动

prefix: 
listProp1: 
    - listValue1 
    - listValue2 
    - listValue3 
listProp2: 
    - listValue1 
    - listValue2 
    - listValue3 
listProp3: 
    - listValue1 
    - listValue2 
    - listValue3 

回答

0

使用JSON结构的属性文件

myMap="{[{"mapKey1": "mapVal1","mapKey2": "mapVal2",},{"mapKey11": "mapVal11","mapKey21": "mapVal22",}]}"