SpringBoot在没配置@ComponentScan的情况下,默认只扫描和主类处于同包下的Class。

主类Application.java:

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
//@ComponentScan(basePackages = "com.自定义.mall")如果不加,只扫描和主类处于同包下的Class。
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

不加的可用情况

必须要加的情况

最新文章

  1. 「拉勾网」薪资调查的小爬虫,并将抓取结果保存到excel中
  2. linux--分卷压缩解压缩
  3. 深入浅出TCP协议的三次握手过程
  4. iOS开发数据库SQLite的使用
  5. CodeForces 492B
  6. SQL Server 2008 修改表名
  7. golang升级
  8. python多线程和多进程使用
  9. 学习使人快乐5-JavaWeb应用的组成结构
  10. bootstrap-table初使用
  11. linux shell脚本检测硬盘磁盘空间 邮件报警
  12. MySQL mysql server与存储引擎
  13. oracle跟踪sql语句
  14. aclocal: error: aclocal: file '/usr/local/share/aclocal/wxwin.m4' does not exist
  15. 希尔伯特曲线——第八届蓝桥杯C语言B组(国赛)第三题
  16. PL/SQL在 win8.1系统下连接Oracle11g没有database处理方法(亲身实验,吐血分享)
  17. 51nod 1486 大大走格子——dp
  18. perl6中函数参数(2)
  19. https过程
  20. C#获取视频文件播放长度

热门文章

  1. 莫比乌斯反演--HDU模板题
  2. MS SQL 2012表分区
  3. 对Python中print函数参数的认识
  4. 指针生成网络(Pointer-Generator-Network)原理与实战
  5. 泛型约束:接口约束、new()构造函数约束、组合约束(即多种约束合并)
  6. 基于C#实现与新大陆扫码枪通信
  7. 关于SpringBoot的自动配置和启动过程
  8. React会自动把虚拟DOM数组展开
  9. yii框架下使用redis
  10. wamp集成环境安装redis