从另一个项目进口春季应用程序上下文 [英] Spring import application context from another project

查看:119
本文介绍了从另一个项目进口春季应用程序上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个项目,其中的一个包括在另一构建路径,它们都有自己的应用程序上下文定义他的豆

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 Transactions so I have to have in one application context the import of both of them, but I didnt found the way to do that.

有更多钞票在不同的项目2个应用程序上下文,并将其导入一个到其他。

It is posible have 2 application context in different project and import one of them to the other.

如果没有可能这将是最好的解决办法?

If there is no possible which would be the best solution?

我想成为2个项目在1。

I have think in become the 2 projects in 1.

感谢和抱歉,我的英语!

Thanks and sorry about my English!

推荐答案

是的,它可以导入;在appcontext XML的之一:

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>

这篇关于从另一个项目进口春季应用程序上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆