标签:注解 @componentscan
@ComponentScan:扫描
@ComponentScan告诉Spring哪个packages的用注解标识的类会被spring自动扫描并且装入bean容器
如:扫描com.liuy.controller
@ComponentScan(basePackages = { "com.liuy.controller" })
如:不扫描含有@ExcludeFromComponentScan注解的类或接口
@ComponentScan(excludeFilters = { @ComponentScan.Filter(type = FilterType.ANNOTATION, value = ExcludeFromComponentScan.class) })
本文出自 “我爱大金子” 博客,请务必保留此出处http://1754966750.blog.51cto.com/7455444/1947226
标签:注解 @componentscan
原文地址:http://1754966750.blog.51cto.com/7455444/1947226