How to understand Spring Ioc Container Bean
This article focuses on "how to understand Spring Ioc Container Bean". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to understand Spring Ioc Container Bean.
Naming of Bean
Bean can have one or more names in the Ioc container, but these names must be unique within the container, and you can alias Bean by configuring the id and name properties in Xml.
In this way, we can get the instance of UserBean by the names user, zhangsan, lisi.
Of course, if you do not configure the id/name attribute for UserBean, the Spring Ioc container will automatically generate a lowercase alias for the first character of the class name without Bean.
In addition, you can also use the