Special Instructions:
1. Question: Can instances of the same class be generated by both the child container and the parent container at the same time?
2. Question: If a class sub-container (appServlet-context.xml) has an instance, and the parent container (applicationContext.xml) also has an instance, which one does getBean use?
3. Question: Does the child container (DispatcherServlet) support AOP?
4. Question: Does the subcontainer support transactions?
Summarize:
1. It is unnecessary to use the parent-child container to avoid having a common instance.
Common resource initialization and preheating multiple times;
如果父子容器都有实例,而通过SpringUtil 的方式获取bean,就要看SpringUtil 所在的容器,来获取对应的bean,也容易混乱
2、事务一般不要放在子容器中,子容器应该仅仅存在 web相关的bean;这也间接说明@Transactional 不应该修饰controller
3、如果希望对子容器的实例拥有事务能力,需要确保<aop:aspectj-autoproxy/> 以及Aspect 配置在子容器中
http://wangxinchun.iteye.com/blog/2341197