zoukankan      html  css  js  c++  java
  • SpringBoot学习之@SpringBootApplication注解

    下面是我们经常见到SpringBoot启动类代码:

    @SpringBootApplication
    public class DemoApplication extends SpringBootServletInitializer {

      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(DemoApplication.class);
      }

      public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
      }
    }

    这里主要关注@SpringBootApplication注解,它包括三个注解:

    @Configuration:表示将该类作用springboot配置文件类。

    @EnableAutoConfiguration:表示程序启动时,自动加载springboot默认的配置。

    @ComponentScan:表示程序启动是,自动扫描当前包及子包下所有类。

  • 相关阅读:
    S03E01 蓝牙操作
    GET与POST方法
    Http请求头与响应头
    HttpClient初步
    Http
    深度为H的满k叉树
    html5-css选择器
    html5-css的使用强制优先级
    html5-样式表的使用-初步
    html5-css的引入
  • 原文地址:https://www.cnblogs.com/michaelShao/p/6694526.html
Copyright © 2011-2022 走看看