当前位置:网站首页>The difference between componentscan and componentscans
The difference between componentscan and componentscans
2022-07-03 02:57:00 【A stream kite CD】
stay Spring in @ComponentScan() It is used to scan the comments under a package ,ComponentScans It is also used to scan annotations , But the difference between them is :
- ComponentScan You can write one or more packages at a time
@ComponentScan It is often annotated in @Configuration In the class , Used to add automatically scanned packages . We can use properties basePackages perhaps value Specify one or more packages to scan .@ComponentScan("com.nn")
@ComponentScan(value = {"com.nn.bean","com.nn.dao"})
- ComponentScans You can declare more than one ComponentScan
@ComponentScans Is another annotation of the scanning package , There is an attribute of the array situation value, The type of array is @ComponentScan, That's one @ComponentScans You can configure multiple @ComponentScan@ComponentScans(value={@ComponentScan("com.nn.bean"),@ComponentScan("com.nn.service")})
边栏推荐
- How to use asp Net MVC identity 2 change password authentication- How To Change Password Validation in ASP. Net MVC Identity 2?
- The process of connecting MySQL with docker
- 一文带你了解 ZigBee
- [shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)
- Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
- random shuffle注意
- 你真的懂继电器吗?
- C language beginner level - pointer explanation - paoding jieniu chapter
- I2C subsystem (II): I3C spec
- I2C subsystem (I): I2C spec
猜你喜欢
The Linux server needs to install the agent software EPS (agent) database
Opengauss database development and debugging tool guide
Summary of interview project technology stack
Practice of traffic recording and playback in vivo
What does "where 1=1" mean
Add automatic model generation function to hade
Your family must be very poor if you fight like this!
Distributed transaction
What is the way out for children from poor families?
Three.js本地环境搭建
随机推荐
基于can总线的A2L文件解析(2)
Notifydatasetchanged not applicable to recyclerview - notifydatasetchanged not working on recyclerview
[fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
SqlServer行转列PIVOT
I2C 子系统(四):I2C debug
Can netstat still play like this?
Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记
Getting started | jetpack hilt dependency injection framework
Distributed transaction
C语言中左值和右值的区别
[Fuhan 6630 encodes and stores videos, and uses RTSP server and timestamp synchronization to realize VLC viewing videos]
力扣------网格中的最小路径代价
Concrete CMS vulnerability
Pytest (6) -fixture (Firmware)
疫情当头,作为Leader如何进行代码版本和需求开发管控?| 社区征文
Three.js本地环境搭建
Change cell color in Excel using C - cell color changing in Excel using C
The process of connecting MySQL with docker
Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
Introduction to cron expression