一、setter DI:
<bean>
<property name="">
<ref bean="bean的name或id"/>
</property>
<property name="">
<!--内部bean-->
<bean></bean>
</property>
<property name="">
<ref local="只能是同一文件的bean的id"/>
</property>
<!--idref元素用来引用其它bean的id,spring会验证id是否存在-->
<property name="">
<idref bean=""/>
</property>
<!--idref元素的local属性用来引用其它bean的id,spring会验证id是否存在,并且验证与引用的bean是否在同一文件-->
<property name="">
<idref local=""/>
</property>
<property name="">
<value></value>
</property>
<property name="" ref=""/>
<property name="" value=""/>
<property name="">
<null/>
</property>
<property name="">
<props>
<prop key=""></prop>
<prop key=""></prop>
</props>
</property>
<property name="">
<list>
<value></value>
<ref bean=""/>
</list>
</property>
<property name="">
<set>
<value></value>
<ref bean=""/>
</set>
</property>
<property name="">
<map>
<entry>
<key>
<value></value>
</key>
<value></value>
</entry>
<entry key="" value=""/><!--推荐-->
<entry key="">
<value>
</value>
</entry>
<entry key-ref="" value-ref=""/>
<entry>
<key>
<value></value>
</key>
<ref bean=""/>
</entry>
</map>
</property>
</bean>
二、contructor DI:
<bean>
<constructor-arg>
<ref bean=""/>
</constructor-arg>
<constructor-arg ref="bean的name或id"/>
<constructor-arg value=""/>
<constructor-arg type="" value=""/>
<constructor-arg index="" value=""/><!--首选-->
</bean>
分享到:
相关推荐
1、ICO环境的搭建 2、属性注入 3、自定义属性编辑器 4、AOP实现 5、事务处理 6、Spring事务配置的五种方式 详解 7、Struts与Spring集成方案
NULL 博文链接:https://tw5566.iteye.com/blog/423883
Spring Security OAuth2.0学习笔记 什么是认证、授权、会话。 Java Servlet为支持http会话做了哪些事儿。 基于session认证机制的运作流程。 基于token认证机制的运作流程。 理解Spring Security的工作原理,Spring ...
学习Spring 2.0时的笔记,辛苦整理与大家分享
此文档适用于初学者,初学者不必再为学习spring而做另一份笔记,借此以足够。
本篇文章主要介绍了超详细的Spring Boot入门笔记(总结),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
一步一步学SpringDataJpa——JpaRepository查询功能 - CSDN博客https://blog.csdn.net/ming070423/a
有大量简单的 API 用来快速地构建代码优先的 Services,各种 Maven 的插件也使集成更加容易,支持 JAX-WS API ,支持 Spring 2.0 更加简化的 XML 配置方式,等等。支持二进制和遗留协议:CXF 的设计是一种可插拨的...
Spring学习笔记...............345 第一章 Spring概述..........................345 第二章 Spring IOC(控制反转)........347 第三章 Spring AOP(面向切面编程)..........351 第四章 Spring中的数据访问.............
springboot实战 笔记整理 包含sprinboot常用的注解 配置 自定义配置 springboot集成测试 actuator 部署 开发工具
到 2.0. 0。因此, 本书采用版本 2.0.0.RELEASE 进行讲解。 Spring Boot 2 . x 平l"I Spring Boot l .x 在使用上 有很多地方存在很多不同,井且只能支持 JDK 8 或者以上版本,这些是读者在阅读本书和实践中需 要注意...
Spring学习笔记...............345 第一章 Spring概述..........................345 第二章 Spring IOC(控制反转)........347 第三章 Spring AOP(面向切面编程)..........351 第四章 Spring中的数据访问.............
6、发布个人学习笔记,并对学习笔记进行维护;7、支付宝在线支付接口,实现在线购买服务功能;8、个人信息管理,个人界面方案维护;9、信息反馈及维护;10、JavaMail邮件发送功能实现。各功能模块的稳定性都经过了...
本资源是基于SpringBoot2.0版本的学习笔记,主要介绍了SpringBoot与SpringCloud的关系以及SpringBoot与SpringMVC的关系,以及各注解的使用情况
java(1) 整合入门(spring,struts,hibernate的整合)资料(1) 中大软件工厂项目前培训资料(1) 完整笔记+源码(1) ssh(1) C#查询参数化例子(1) 学习笔记+完整源码(1) 介绍与深入(1) 学习笔记(不含整合)(1) C#(1) .CHM格式...
Appfuse是Matt Raible 开发的一个指导性的入门级J2EE框架,它对如何集成流行的Spring、Hibernate、iBatis、Struts、xDcolet、Junit、Taperstry、JSF等基础框架给出...AppFuse2.0重构了AppFuse1.0,转到Maven2和Jdk1.5。
Appfuse 一个开放源码的项目和应用程序,帮助我们快速而高效的地开发。 Appfuse是Matt Raible 开发的一个指导性的入门级J2EE框架,它对如何集成流行的Spring、...AppFuse2.0重构了AppFuse1.0,转到Maven2和Jdk1.5。