Spring internal bean and space naming
Internal bean
In fact, the internal bean is very easy to assemble a bean inside a bean, so the internal bean cannot be used by other beans at this time. Generally, beans under the beans node can be used by any bean. If we want a bean to be used only by a specific bean, we can use an internal bean at this time. The internal bean is used for both setter and constructor:
Instance: "P" class = "Bean1.People">
"Bean1.ChineseLanguage">
"P" class = "Bean1.People">
"Bean1.ChineseLanguage">
Space name p assembly
The space name p Assembly bean is a simpler method, which is no different from the role of property and constructor-arg. To use this method, you need to add: xmlns: p = "http://www.springframework.org/schema/p to beans
Instance:
P: property name = "for non-reference type
P: attribute name-ref = "for reference type