on-internet
← Community

How to import a spring application context into another application context?

Stack Overflow ·

I have two spring application contexts. One is local to my application and the other is from one of the maven dependencies. Now, my applicationContext.xml file look like this. <import resource="classpath*:**/sample-applicationContext.xml" /> and I have <context:component-scan> in the sample-applicationContext.xml file which scans for components. and Now, when I do the following.. ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml"); MyClass m=ctx.getBean(MyClass.class); Unfortunately, when I get the MyClass object, the object is created however, I see that depend

Comments

Sign in or sign up to comment and upvote.

No comments yet.