Ask Your Question
0

What is the process of including a map<String,Map<String,Integer>> in application.properties?

asked 2023-06-14 17:38:32 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-14 17:43:01 +0000

woof gravatar image

To include a map<string,map<string,integer>> in application.properties, you can use the following syntax:

map.key1.key2=value1 map.key1.key3=value2 map.key4.key5=value3

Here, the "map" represents the name of the map, "key1" represents the first key of the inner map, "key2" and "key3" represent the second keys of the inner map, and "value1" and "value2" represent the corresponding values.

To use this map in your application, you can use the @Value annotation in your code, like this:

@Value("#{${map}}") private Map<string, map<string,="" integer="">> myMap;

This will inject the map into your code.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-14 17:38:32 +0000

Seen: 18 times

Last updated: Jun 14 '23