Created
January 16, 2019 11:14
-
-
Save zacker330/bb0acb23e44602e7b17ddabea6ad78c4 to your computer and use it in GitHub Desktop.
[打印所有的bean] #springboot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ConfigurableApplicationContext applicationContext = SpringApplication.run(WebServer.class, args); | |
String[] beanNames = applicationContext.getBeanDefinitionNames(); | |
System.out.println("" + beanNames.length); | |
for (String bn : beanNames) { | |
System.out.println("zhaizj:" + bn); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment