I use contexts that reference beans specified in other contexts. For example, context A.xml uses a bean in B.xml.
If I were using a ClassPathXmlApplicationContext to get the context, I'd have to load them with:
But it would be a lot cleaner to simply load them with:Code:ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"A.xml", "B.xml"});
and have 'something' in A.xml that tells it to load B.xml from the classpath.Code:ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"A.xml"});
I know that 'something' must exist. What is it, and what is its syntax?


Reply With Quote