摘要:
1. 使用java的方式配置Spring 实体类User // 这里的这个注解的意思,就是说明这个类被Spring托管了,注册到了容器中 @Controller public class User { // 属性的注入 @Value("cnfalltime") private String name 阅读全文
摘要:
1.1说明 在spring4之后,想要使用注解形式,必须得要引入aop的包 在配置文件当中,还得要引入一个context约束 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/sch 阅读全文
摘要:
1.Bean的自动装配 自动装配是使用spring满足bean依赖的一种方法 spring会在应用上下文中为某个bean寻找其依赖的bean。 Spring中bean有三种装配机制,分别是: 在xml中显式配置; 在java中显式配置; 隐式的bean发现机制和自动装配。 这里我们主要讲第三种:自动 阅读全文