Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I suggest you have a look at the <code>org.springframework.context.support.GenericApplicationContext</code>. Together with an <code>org.springframework.beans.factory.xml.XmlBeanDefinitionReader</code> it shoudl give you the flexibility you want. There is an example of code on the <a href="http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/context/support/GenericApplicationContext.html" rel="nofollow noreferrer"><code>GenericApplicationContext</code>'s javadoc</a></p> <p>Your code would look like:</p> <pre><code>GenericApplicationContext ctx = new GenericApplicationContext(); XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx); xmlReader.loadBeanDefinitions(new ClassPathResource("classpathContext.xml")); xmlReader.loadBeanDefinitions(new FileSystemResource("fileSystemContext.xml")); </code></pre> <p>Note the <code>XmlBeanDefinitionReader</code> also has a method <code>loadBeanDefinitions(String)</code> which will then use <a href="http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/core/io/ResourceLoader.html" rel="nofollow noreferrer"><code>org.springframework.core.io.ResourceLoader</code></a> to handle the appropriate resource. In which case your code would look like:</p> <pre><code>GenericApplicationContext ctx = new GenericApplicationContext(); XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx); xmlReader.loadBeanDefinitions("classpath:classpathContext.xml")); xmlReader.loadBeanDefinitions("file:fileSystemContext.xml")); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload