Dr. Lofi Dewanto
1 min readJun 11, 2019

--

This is the “magic” in Spring Framework.

“… Even typed Maps can be autowired as long as the expected key type is String. The Map values will contain all beans of the expected type, and the keys will contain the corresponding bean names” (see Spring documentation for details).”

Spring Framework initializes the map “automagically” in the init time of the Application Context and inserts the content with all the expected type and use the bean name as the key in the map (String).

You don’t need to do anything for this.

Hope this helps,
Lofi

--

--

No responses yet