Spring Context Hierarchy with Web Application Context?

If you are using annotations, you can do this.

If you are using annotations, you can do this: @Inject private XmlWebApplicationContext context; @Inject private List childs; @PostConstruct public void refreshContext() { for(ClassPathXmlApplicationContext appContext : childs) { appContext. SetParent(context); } context.refresh(); } You can do it without annotations too, by using the interfaces InitializingBean and ApplicationContextAware. Edited: childs is autowired by type, so Spring will inject all the bean that are being an instance of ClassPathXmlApplicationContext.

– aha May 18 '11 at 13:29 I tried the code you propose. It works, but doesn't propagate to the ContextSingletonBeanFactoryLocator. But it leads in the right direction: The way to go is not to use a ContextSingletonBeanFactoryLocator but to manually load the child contexts (using a GenericApplicationContext) and attach them to the parent context in a InitializingBean.

– aha May 26 '11 at 10:11.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions