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.
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>
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With