show all spring boot beans

Solutions on MaxInterview for show all spring boot beans by the best coders in the world

showing results for - "show all spring boot beans"
Fabiana
02 Oct 2018
1@Bean
2	public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
3		return args -> {
4
5			System.out.println("Let's inspect the beans provided by Spring Boot:");
6
7			String[] beanNames = ctx.getBeanDefinitionNames();
8			Arrays.sort(beanNames);
9			for (String beanName : beanNames) {
10				System.out.println("my beans "+beanName);
11			}
12		};
13	}