当前位置:网站首页>ComponentScan和ComponentScans的区别
ComponentScan和ComponentScans的区别
2022-07-03 02:56:00 【一尾流鸢cd】
在Spring中@ComponentScan()被用来扫描某包下的注解,ComponentScans也是用来扫描注解的,但是它们之间的不同是:
- ComponentScan可以每次写一个或者多个包
@ComponentScan往往是注解在@Configuration的类中,用于添加自动扫描的包。我们可以通过属性basePackages或者value指定一个或者多个要扫描的包。@ComponentScan("com.nn")@ComponentScan(value = {"com.nn.bean","com.nn.dao"})- ComponentScans可以声明多个ComponentScan
@ComponentScans是另外一个扫描包的注解,有一个数组形势的属性value,而数组的类型就是@ComponentScan,也就是一个@ComponentScans中可以配置多个@ComponentScan@ComponentScans(value={@ComponentScan("com.nn.bean"),@ComponentScan("com.nn.service")})

边栏推荐
- Installation and use of memory leak tool VLD
- 2022-2028 global splicing display industry research and trend analysis report
- HTB-Devel
- [translation] the background project has joined the CNCF incubator
- Le processus de connexion mysql avec docker
- 内存泄漏工具VLD安装及使用
- Kubernetes family container housekeeper pod online Q & A?
- [fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
- Check log4j problems using stain analysis
- tensor中的append应该如何实现
猜你喜欢

Sqlserver row to column pivot

The process of connecting MySQL with docker

左连接,内连接
![[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)](/img/04/88ce45d370a2e6052c2fce558aa531.jpg)
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)

Kubernetes cluster log and efk architecture log scheme

Practice of traffic recording and playback in vivo

Today, it's time to copy the bottom!

C语言初阶-指针详解-庖丁解牛篇

Opengauss database development and debugging tool guide

I2C subsystem (II): I3C spec
随机推荐
为什么会选择框架?选择什么样的框架
【富瀚6630编码存录像,用rtsp服务器及时间戳同步实现vlc观看录像】
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
How to limit the size of the dictionary- How to limit the size of a dictionary?
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]
Matlab tips (24) RBF, GRNN, PNN neural network
SqlServer行转列PIVOT
How do you adjust the scope of activerecord Association in rails 3- How do you scope ActiveRecord associations in Rails 3?
[C language] MD5 encryption for account password
Three.js本地环境搭建
Add automatic model generation function to hade
[fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)
Kubernetes cluster log and efk architecture log scheme
I2C 子系统(二):I3C spec
用docker 连接mysql的过程
yii2 中andWhere多个or查询 orm条件
The difference between left value and right value in C language
Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
From C to capable -- use the pointer as a function parameter to find out whether the string is a palindrome character
Variable declarations following if statements