首页 > 代码库 > Spring Boot(一)启动方式

Spring Boot(一)启动方式

1、系统自动生成SpringApplication.run(XX.class, args);2、创建SpringApplication对象SpringApplication app = new SpringApplication(DemoApplication.class);app.setBannerMode(Banner.Mode.OFF);app.run();3、Fluent Builder API 构造者模式 也可以把参数放在run中1)new SpringApplicationBuilder(DemoApplication.class).bannerMode(Banner.Mode.CONSOLE).run();2)new SpringApplicationBuilder().sources(DemoApplication.class).bannerMode(Banner.Mode.OFF).run();3)new SpringApplicationBuilder().sources(DemoApplication.class).bannerMode(Banner.Mode.OFF).build(args).run();

  

Spring Boot(一)启动方式