【问题标题】:Difference between id and name spring attribute [duplicate]id和name spring属性之间的区别[重复]
【发布时间】:2015-05-19 15:32:41
【问题描述】:

我们可以同时为 spring bean 指定 idname 属性,但是它们之间有什么区别呢?在我们的项目中,我们只使用 id 属性,如下所示:

<bean id="myBean" class="com.foo.bar.MyBeanClass">
    <!-- Properties -->
</bean>

我想了解应该使用名称属性的情况。我只是在项目中从未遇到过。

【问题讨论】:

  • 你读过spring文档吗?
  • @Jens 当然,我有。为什么我们必须使用多个别名?

标签: java spring


【解决方案1】:

检查 this 以获取 id 和 name 之间的完整定义。

希望对你有帮助

【讨论】:

    猜你喜欢
    • 2019-03-19
    • 2010-11-26
    • 1970-01-01
    • 2020-12-30
    • 2012-01-31
    • 2014-02-09
    • 2011-10-08
    • 2013-03-07
    • 1970-01-01
    相关资源
    最近更新 更多