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.
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
Asked: 2023-06-14 17:38:32 +0000
Seen: 18 times
Last updated: Jun 14 '23
What is the method to transmit a map<String,Map<String,Integer>> along with application.properties?
What is the procedure to remove all markers and layers from a Leaflet map in order to add new ones?
How can I get the choropleth map to display on Jupyter Notebook when using Plotly Express?
How can I show several locations on a Leaflet map using GraphHopper?
How do I obtain Latin-1 codes for particular characters?
How can one go over a key/value map object by repeatedly executing its elements?
How can one display grid labels on a Southpolar stereographic map in cartopy?