????:主要有两种

  1. 第一种就是我们前面实例中使用的方法,在Controller类中配置EnableAutoConfiguration,创建一个main方法,使SpringApplication启动程序。
  2. 第一种方法每次只能启动一个控制器,所有比较不常用,常用的是第二种方法
    springBoot入门三(SpringBoot的启动方式)
    在App类中配置EnableAutoConfiguration和组件扫描ComponentScan,
    然后使用SpringApplication启动程序,这样就可以访问多个Controller了。
    springBoot入门三(SpringBoot的启动方式)
    springBoot入门三(SpringBoot的启动方式)

相关文章:

  • 2021-11-18
  • 2022-12-23
  • 2021-09-24
  • 2021-04-30
猜你喜欢
  • 2021-05-31
  • 2021-11-18
  • 2021-11-18
相关资源
相似解决方案