I have a java configuration class that imports XML files with @ImportResources annotation. In java config, I would like to reference the beans that are defined in the xml configuration, for example. as:
@Configuration @ImportResource({ "classpath:WEB-INF/somebeans.xml" } ) public class MyConfig { @Bean public Bar bar() { Bar bar = new Bar(); bar.setFoo(foo);
I would like to set the bean foo, which was defined in somebeans.xml, to the bean panel that will be created in the java config class. How to get foo bean?
James source share