开发者

spring: how to add a property of a bean as a constructor arg

I have a bean (bean1) which has a method called getProperties()

I开发者_运维知识库 need to pass the value of getProperties() as a constructor arg of another bean

Something like:

<constructor-arg ref="bean1.properties"/>

which does now work. How can I do it?

Thank you very much


You could use the Spring Expression Language for this.

Example:

<constructor-arg value="#{bean1.properties}"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜