# 01-StudentApp
Student Details using Spring boot to demonstrate @ComponetScan @Component @Bean Annotation
Analyze @component has higher priority in making spring bean object by the spring IOC container
compare to @Bean annotation which has low priority and executed and bean creation process is done after @component.
Execution starts from Application class main method()
Spring IOC container will create objects for those classes only which are in the main package, also subpackages annotated with @Component annotation
Spring IOC container will not create objects for other packages or subpackagesother than main package even if they annotated with @Component annotation.
In order to make aware to IOC container about other packages mention package name in @ComponetScan annotation as
@ComponentScan(basePackages = "com.student.one","com.student.two")
没有合适的资源?快使用搜索试试~ 我知道了~
01-StudentApp:学生详细信息使用Spring引导来演示@ComponetScan @Component @Bean注...
共12个文件
java:7个
properties:1个
cmd:1个
需积分: 21 1 下载量 20 浏览量
2021-02-16
22:40:15
上传
评论
收藏 13KB ZIP 举报
温馨提示
01-学生应用 学生详细信息使用Spring Boot演示@ComponetScan @Component @Bean注释与使用低优先级并执行的@Bean注释相比,通过Spring IOC容器分析@component在使spring Bean对象成为对象时具有更高的优先级,并且在@component之后完成Bean创建过程。 从Application类main方法开始执行 Spring IOC容器将仅为那些在主包中的类创建对象,这些子包也以@Component批注进行注释 Spring IOC容器不会为除主包之外的其他包或子包创建对象,即使它们使用@Component注释进行了注释。 为了使IOC容器了解其他软件包,请在@ComponetScan批注中将软件包名称提及为 @ComponentScan(basePackages =“ com.student.one”,“ com.stud
资源详情
资源评论
资源推荐
收起资源包目录
01-StudentApp-main.zip (12个子文件)
01-StudentApp-main
README.md 863B
pom.xml 1KB
mvnw 10KB
src
test
java
com
university
StudentDetails
StudentDetailsApplicationTests.java 229B
main
resources
application.properties 1B
java
com
university
studentsecurity
StudentSecurity.java 238B
StudentDetails
dao
StudentDao.java 235B
Address.java 224B
service
StudentService.java 253B
Student.java 224B
StudentDetailsApplication.java 829B
mvnw.cmd 6KB
共 12 条
- 1
居居是居居啦
- 粉丝: 23
- 资源: 4657
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0