Every bean has one or more identifiers. These identifiers must be unique within the container that hosts the bean. A bean usually has only one identifier, but if it requires more than one, the extra ones can be considered aliases. In XML-based configuration metadata, you use the id and/or name attributes to specify the bean identifier(s). The id attribute allows you to specify exactly one id. If you want to introduce other aliases to the bean, you can also specify them in the name attribute, separated by a comma (,),
semicolon (;), or white space.
也就是说:
id和name本质上其实是相同的,都可以唯一地标识一个bean。区别是id只能定义一个值,name可以定义多个值(separated by a comma (,), semicolon (;), or white space)。
参考文章:
https://www.iteye.com/blog/jinnianshilongnian-1413857
Spring配置文件中关于bean标签的id属性和name属性的说明
原文:https://www.cnblogs.com/AbnerRao/p/12953121.html