Java, Software Development, Spring, Spring Boot

Spring Boot – List all Beans loaded in the ApplicationContext

With Spring Boot, a lot of beans get loaded into the ApplicationContext depending on your dependencies selection. This post shows a code snippet used to list all the beans loaded in the ApplicationContext.

Your Typical Main Class

Consider the following code snippet. You can use IntelliJ (optional) and Spring Initialzr (https://start.spring.io) to generate the initial codes and pom.xml.

Get and used ApplicationContext

Modify the original codes to these. Notice the lines 10-16.

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like