In my current grails application, I have spring beans defined in resources.groovy. Now I also have an xml file with a bunch of beans already defined, and I would like to use them as is instead of recreating every single bean in the bean dsl.
Is this possible at all ? Is there an equivalent of the xml import tag in grails bean dsl ? I thought about adding the import ... in applicationContext.xml but I'm not sure that's the right place to do it.
Thanks in advance,
Philippe
You may load multiple Spring bean configuration files in the code : ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"Spring-Common. xml", "Spring-Connection. xml","Spring-ModuleA.
The beans. xml file is the bean archive descriptor for CDI applications. It can be used for any CDI compliant container, such as Weld which is included in WildFly application server.
XMLBeans is a technology for accessing XML by binding it to Java types. XMLBeans provides several ways to get at the XML, including: Through XML schema that has been compiled to generate Java types that represent schema types.
You can import the beans in an XML file into resources.groovy
using
beans = {
importBeans('classpath:/applicationContext-services.xml')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With