Load spring beans from custom groovy files in grails app

前端 未结 4 1984
天命终不由人
天命终不由人 2021-01-17 23:46

Trying to load spring beans from custom groovy file in Grails 2.3.7. I know this question has been asked before, but after hours of searching, I\'m unable to fi

4条回答
  •  醉梦人生
    2021-01-18 00:39

    We can import beans from different groovy/xml file in the following way too : - use the following in resources.groovy -

    importBeans 'file:camel-beans.groovy' OR importBeans('classpath:/camel-config.xml')

    Place camel-beans.groovy along with resources.groovy and provide package as "package spring" for first case, otherwise put it in web app classpath and use the second way to do it.

提交回复
热议问题