Spring import application context from another project

前端 未结 2 1222
情深已故
情深已故 2021-01-04 09:09

I have 2 projects, one of them is included in the other one build path, both of them have his own application context defining his beans.

I want to manage Global Tra

相关标签:
2条回答
  • 2021-01-04 09:23

    This oldish Spring blog post describes pretty much exactly what you're trying to do.

    http://blog.springsource.com/2007/06/11/using-a-shared-parent-application-context-in-a-multi-war-spring-application/

    0 讨论(0)
  • 2021-01-04 09:37

    Yes it is possible to import; in one of your appcontext xmls:

    <beans>
    
        <import 
            resource="classpath*:/META-INF/whatever/root/to/otherAppContext.xml" />
    
        <bean id="beanA" class="..."/>
        <bean id="beanB" class="..."/>
    
    </beans>
    
    0 讨论(0)
提交回复
热议问题