摘要: 首先回顾下在xml中我们是如何为spring的bean进行属性赋值呢? 大体是这样的 这样就能够为person对象的 和`name`属性进行赋值。 那使用@Value注解怎么做呢?又如何取出配置文件中的值呢,就像取出jdbc.properties中的值一样。 配置类: 写个测试方法测试一下: 打印出 阅读全文
posted @ 2019-08-22 20:01 HeliusKing 阅读(598) 评论(0) 推荐(0) 编辑
摘要: 附上关于这节的spring官方文档: "ApplicationContextAware and BeanNameAware" aware接口在spring中无处不在,它是用来感知spring的ioc container 引用spring官方的一句话: Spring offers a range of 阅读全文
posted @ 2019-08-22 09:16 HeliusKing 阅读(323) 评论(0) 推荐(0) 编辑