开发者

Lookup Groovy Beans in App Context

开发者 https://www.devze.com 2023-02-17 10:50 出处:网络
I have several Gro开发者_开发百科ovy beans defined within my app context file, like so: <lang:groovy id=\"bean1\">

I have several Gro开发者_开发百科ovy beans defined within my app context file, like so:

<lang:groovy id="bean1">
   ...
</lang:groovy>

I would like to get a list of all the groovy beans from the ApplicationContext, but don't see a clean way to do this.

Is there a straightforward way to get a list of all the Groovy implemented beans?

I am using Spring 3.


applicationContext.getBeansForType(Class.forName("groovy.lang.GroovyObject"));

See ListableBeanFactory Javadoc.

0

精彩评论

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