Skip to content

Allow short-form "idref" properties in addition to "ref" [SPR-2444] #7133

@spring-projects-issues

Description

@spring-projects-issues

Antranig Basman opened SPR-2444 and commented

Although in Spring 1.2 the "short form" attribute syntax for properties allows bean references and values ("ref" and "value") to be specified inline, currently there is no way to do this for references to the names of beans, for example the following

<bean id="defaultViewProxy" parent="RSACStringBridge">
<property name="targetBeanName">
<idref bean="defaultView" />
</property>
</bean>

could be written in the proposed syntax

<bean id="defaultViewProxy" parent="RSACStringBridge">
<property name="targetBeanName" idref="defaultView"/>
</bean>

Currently the only workaround is to use "value" in place of "idref" if one wants a short form.

I believe this case is common enough, and the extra link-safety provided by idref is valuable enough to make this small change worthwhile.


Affects: 2.0 RC3

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions