Skip to content

Instantly share code, notes, and snippets.

@zacker330
Created January 16, 2019 11:14
Show Gist options
  • Save zacker330/bb0acb23e44602e7b17ddabea6ad78c4 to your computer and use it in GitHub Desktop.
Save zacker330/bb0acb23e44602e7b17ddabea6ad78c4 to your computer and use it in GitHub Desktop.
[打印所有的bean] #springboot
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