首页 > 编程语言 > 详细

Springboot知识点总结

时间:2020-08-05 00:25:38      阅读:149      评论:0      收藏:0      [点我收藏+]

1、SpringBoot工程热部署

  目的是避免开发时修改了源码还要重新启动的麻烦

  解决方案:在pom.xml文件中添加热部署配置

<!--springboot热部署,避免重启服务器-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>

  IDEA需要设置

技术分享图片

 

技术分享图片

勾选Build project automatically  然后关闭

 

按shift+Ctrl+Alt+/

技术分享图片

 

技术分享图片

 

2、springboot自动配置功能 

  @SpringBootApplication注解里有多个注解{
    1、@SpringBootApplication
    1.1、@SpringBootConfiguration{
        1.1.1@Configuration{表名这是一个配置类}
    }

    
1.2@ComponentScan{
          1.2.1@Repeatable(ComponentScans.class){约定@ComponentScan所在的包及汽车子包下的类都能扫描}
     }

    1.3@EnableAutoConfiguration{自动配置主要原因
            1.3.1@Import({AutoConfigurationImportSelector.class})

    }
 

  }

 

Springboot知识点总结

原文:https://www.cnblogs.com/liugaoyanging/p/13436758.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!