title: Spring MVC contexts: adding beans to root application context
body: <p>I am working on web app and I use Spring MVC. It has one servlet. So if I am right, it is supposed to have one root application context and additional application context for that servlet. Beans in servlet application context can access beans in root application context. However, let's say app started, and I want to add some beans to root application context, how should I proceed? Basically, I have some bean configs in "additional-beans.xml". I want to add them to root application context but not at init point, but some time after the web app has started. How to do that? Seems like doing something like </p>
  
  <pre><code>AbstractApplicationContext rootContext = new ClassPathXmlApplicationContext(new String[]{"additional-beans.xml"});
  </code></pre>
  
  <p>withing one of my controllers will not add additional beans to the root application context. But then, where are they added? Is it even possible? THanks) </p>