spring bean autowire自动装配
摘要:
转自:http://blog.csdn.net/xiao_jun_0820/article/details/7233139autowire="byName"会自动装配属性与Bean id相同的Bean,例如有两个BEAN,UserService类中有一个userDAO属性:private IUserDAO userDAO;public IUserDAO getUserDAO() {return userDAO;}public void setUserDAO(IUserDAO userDAO) {this.userDAO = userDAO;}这样在创建userService 阅读全文
posted @ 2014-04-10 16:22 王培 阅读(1332) 评论(0) 推荐(0) 编辑