Results 1 to 3 of 3

Thread: Specifying context dependencies... in the context.

  1. #1
    Join Date
    Aug 2006
    Posts
    143

    Exclamation Specifying context dependencies... in the context.

    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:
    Code:
    ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"A.xml", "B.xml"});
    But it would be a lot cleaner to simply load them with:
    Code:
    ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"A.xml"});
    and have 'something' in A.xml that tells it to load B.xml from the classpath.

    I know that 'something' must exist. What is it, and what is its syntax?

  2. #2

    Default

    <import resource="B.xml" />

  3. #3
    Join Date
    Aug 2006
    Posts
    143

    Default

    So simple and obvious... yet I've been looking for it for months.

    THANK YOU!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •