Spring从另一个项目导入应用程序上下文
我有 2 个项目,其中一个包含在另一个构建路径中,它们都有自己的应用程序上下文定义他的 bean。
我想管理全局事务,所以我必须在一个应用程序上下文中导入它们,但我没有找到实现这一点的方法。
不同的项目中可以有 2 个应用程序上下文,并将其中一个导入到另一个中。
如果不可能,哪一个是最好的解决方案?
我想把2个项目变成1个项目。
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 didn't find the way to do that.
It is possible 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?
I have think in become the 2 projects in 1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,可以导入;在您的 appcontext xml 之一中:
Yes it is possible to import; in one of your appcontext xmls:
这篇古老的 Spring 博客文章几乎准确地描述了您想要做的事情。
http:// /blog.springsource.com/2007/06/11/using-a-shared-parent-application-context-in-a-multi-war-spring-application/
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/