Spring配置中<bean>的id和name属性区分
来源:互联网 发布:51单片机c语言教程pda 编辑:程序博客网 时间:2024/05/22 17:02
Every bean has one or more ids (also called identifiers, or names; these terms refer to the same thing). These ids must be unique within the container the bean is hosted in. A bean will almost always have only one id, but if a bean has more than one id, the extra ones can essentially be considered aliases.
When using XML-based configuration metadata, you use the 'id' or 'name' attributes to specify the bean identifier(s). The 'id' attribute allows you to specify exactly one id, and as it is a real XML element ID attribute, the XML parser is able to do some extra validation when other elements reference the id; as such, it is the preferred way to specify a bean id. However, the XML specification does limit the characters which are legal in XML IDs. This is usually not a constraint, but if you have a need to use one of these special XML characters, or want to introduce other aliases to the bean, you may also or instead specify one or more bean ids, separated by a comma (,), semicolon (;), or whitespace in the 'name' attribute.
Please note that you are not required to supply a name for a bean. If no name is supplied explicitly, the container will generate a unique name for that bean. The motivations for not supplying a name for a bean will be discussed later (one use case is inner beans).——出自http://docs.spring.io/spring/docs/2.5.x/reference/beans.html#beans-beanname
- Spring配置中<bean>的id和name属性区分
- Spring配置中<bean>的id和name属性区分
- Spring配置中<bean>的id和name属性区分
- Spring配置中<bean>的id和name属性区分
- Spring配置中<bean>的id和name属性
- Spring配置中<bean>的id和name属性区别
- Spring 配置文件中Bean 属性id和name的区别
- 谈谈Spring配置中<bean>的id和name属性的花拳秀腿
- spring配置<bean>中id和name的区别
- spring配置中id和name属性的区别
- spring配置中id和name属性的区别
- spring配置文件中<bean>的id和name属性区别,以及identifier和aliases
- Spring bean的属性id与name
- Spring中applicationContext.xml的bean里的id和name属性区别
- Spring中applicationContext.xml的bean里的id和name属性区别
- Spring配置bean时id和name
- Spring配置bean时id和name的相关讨论
- Spring配置bean时id和name的相关讨论
- 前端不为人知的一面———前端冷知识集锦
- maven使用的总结
- Charles使用教程
- HTTP/1.1 500 Internal Server Error
- [LeetCode][Java] Permutations
- Spring配置中<bean>的id和name属性区分
- maven用途、核心概念、用法、常用参数和命令、扩展
- Xcode如何添加pch文件
- Android 自定义控件
- Java设计模式----工厂模式(一)
- STM32F030, 使用嘀嗒定时器Systick实现LED闪烁
- 程序员奇葩面试的奇葩问题
- Maven发布项目
- Windows 安装 node.js