摘要: 1、@Autowired与@Resource都可以用来装配bean. 都可以写在字段上,或写在setter方法上。 2、@Autowired默认按类型装配(这个注解是属业spring的),默认情况下必须要求依赖对象必须存在,如果要允许null 值,可以设置它的required属性为false,如:@ 阅读全文
posted @ 2016-10-28 19:17 穆穆兔兔 阅读(157) 评论(0) 推荐(0)
摘要: 官方文档 翻译 https://waylau.gitbooks.io/spring-framework-4-reference/content/III.%20Core%20Technologies/Container%20overview.html 这个更全一些 http://spring.cndo 阅读全文
posted @ 2016-10-28 16:20 穆穆兔兔 阅读(177) 评论(0) 推荐(0)