Every bean has one or more identifiers or names. These ids must be unique within the container the bean is hosted in. If a bean has more than one id the extra ids are called aliases.
We use ‘id’ or ‘name’ to specify the bean in XML based configuration. ‘id’ attribute allows us to give exactly one id and this is real XML id attributes. Instead of creating aliases for a bean if we want create more bean ids we do so in ‘name’ attribute separated by comma(,), semicolon(;), or white space.
It is not required to give name to a bean , if we do not give a name to the bean the container will generate a unique name for the bean.
No comments:
Post a Comment