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();

  

posted @ 2016-08-30 16:44  GrandKai  阅读(6732)  评论(0编辑  收藏  举报