开发者

Inject external object in a spring bean

I have a noob spring questi开发者_StackOverflowon. if i have a bean that is dependent on google's gdata api jars. How I represent this in a beans.xml file?


<bean class="com.google.foo.bar.ExternalClass" id="yourExternalBeanName" />

Then you can inject this 3rd party bean in your classes. With XML:

<property name="yourProperty" ref="yourExternalBeanName" />

or annotations:

@Inject
private ExternalClass yourProperty;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜