Skip to content

Provide programmatic access to inner beans [SPR-8068] #12723

Closed
@spring-projects-issues

Description

@spring-projects-issues

Liu, Yinwei David opened SPR-8068 and commented

Is it possible to add a new API to allow user access inner bean in the context?

According to the javadoc of ApplicationContext.getBeansOfType(Class type), it won't return the nested beans, This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.
Could you please let me know how we get nested bean from ApplicationContext?

e.g. we cannot get the bean b1 from application context by calling getBeansOfType.

<bean id="a1" class="class.A">
    <property name="b">
     <bean name="b1" class="class.B"/>
</property>
</bean> 

Affects: 3.0.5

Issue Links:

1 votes, 3 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: bulk-closedAn outdated, unresolved issue that's closed in bulk as part of a cleaning process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions