@SpringBootApplication
public class SpringbootSimpleDemo1Application {gitpublic static void main(String[] args) {
SpringApplication.run(SpringbootSimpleDemo1Application.class, args);
}
}github
@SpringBootApplication
public class SpringbootSimpleDemo1Application {webpublic static void main(String[] args) {
SpringApplication application = new SpringApplication(SpringbootSimpleDemo1Application.class);
application.run(args);
}
}spring
@SpringBootApplication
public class SpringbootSimpleDemo1Application {springbootpublic static void main(String[] args) {
//第三種 構造者模式
new SpringApplicationBuilder(SpringbootSimpleDemo1Application.class).build(args).run();
//new SpringApplicationBuilder().sources(SpringbootSimpleDemo1Application.class).build(args).run();
//new SpringApplicationBuilder(SpringbootSimpleDemo1Application.class).web(true).run(args);
}
}app
案例:https://github.com/mengzhang6/springboot-demoui
新增spa
public class SpringbootSimpleDemo1Application { public static void main(String[] args) { new SpringApplicationBuilder(BootStart.class).web(true).run(args); } @SpringBootApplication public static class BootStart { } }