Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

show all spring boot beans

@Bean
	public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
		return args -> {

			System.out.println("Let's inspect the beans provided by Spring Boot:");

			String[] beanNames = ctx.getBeanDefinitionNames();
			Arrays.sort(beanNames);
			for (String beanName : beanNames) {
				System.out.println("my beans "+beanName);
			}
		};
	}
 
PREVIOUS NEXT
Tagged: #show #spring #boot #beans
ADD COMMENT
Topic
Name
6+7 =