1.直接在Controller类中添加主类启动Springboot的两种启动方式

2.将所有的Controller集中放置在App类中:必须要添加一个包扫描的注释:
@ComponentScan(basePackages={" “,” "}
Springboot的两种启动方式

相关文章: