![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
文章平均质量分 57
Leeander
这个作者很懒,什么都没留下…
展开
-
Spring5注解
IOC:控制反转,把创建对象过程交给 Spring 进行1、什么是注解(1)注解是代码特殊标记,格式:@注解名称(属性名称=属性值, 属性名称=属性值..)(2)使用注解,注解作用在类上面,方法上面,属性上面(3)使用注解目的:简化 xml 配置2、Spring 针对 Bean 管理中创建对象提供注解(1)@Component(2)@Service(3)@Controller(4)@Repository* 上面四个注解功能是一样的,都可以用来创建 bean 实例3、基于注解方式原创 2021-05-15 15:25:29 · 341 阅读 · 0 评论 -
Spring注解
组件添加:@Bean@Configuration@Component@Component@Controller@Repository@Conditional@Primary@Lazy@Scope@ImportImportSelector组件赋值@Value@Autowired@Qualifier@Resources(JSR250)@Inject(JSR330,需要导入javax.inject)@PropertySource@Pr原创 2021-05-15 15:24:46 · 50 阅读 · 0 评论