当前位置:网站首页>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")})
边栏推荐
- The solution of "the required function is not supported" in win10 remote desktop connection is to modify the Registry [easy to understand]
- MATLAB小技巧(24)RBF,GRNN,PNN-神经网络
- random shuffle注意
- [C语言]给账号密码进行MD5加密
- [hcia]no.15 communication between VLANs
- Source code analysis | resource loading resources
- xiaodi-笔记
- "Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b
- Kubernetes cluster log and efk architecture log scheme
- Why choose a frame? What frame to choose
猜你喜欢
Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)
Today, it's time to copy the bottom!
Three. JS local environment setup
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
Kubernetes family container housekeeper pod online Q & A?
I2C 子系統(四):I2C debug
内存泄漏工具VLD安装及使用
I2C 子系统(四):I2C debug
Sqlserver row to column pivot
随机推荐
I2C subsystem (II): I3C spec
Add automatic model generation function to hade
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
[fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)
一文带你了解 ZigBee
[Fuhan 6630 encodes and stores videos, and uses RTSP server and timestamp synchronization to realize VLC viewing videos]
【翻译】具有集中控制平面的现代应用负载平衡
Process the dataset and use labelencoder to convert all IDs to start from 0
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
The process of connecting MySQL with docker
Xiaodi notes
左值右指解释的比较好的
Source code analysis | layout file loading process
Basic operation of binary tree (C language version)
How do you adjust the scope of activerecord Association in rails 3- How do you scope ActiveRecord associations in Rails 3?
[fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
random shuffle注意
How to change the panet layer in yolov5 to bifpn
I2C 子系统(一):I2C spec
Chart. JS multitooltip tag - chart js multiTooltip labels