inside one ear many war share the common spring context
reference: http://imranbohoran.blogspot.com/2011/02/multiple-web-applications-one-spring.html http://spring.io/blog/2007/06/11/using-a-shared-parent-application-context-in-a-multi-war-spring-application/
Task List:
-
modify web.xml war add: locatorFactorySelector classpath:common-beans.xml
-
in common-beans.xml
services-context1.xml services-context2.xml ... services-contextN.xml- if use servlet 3 spring, in WebApplicationInitializer use sc.setInitParameter("parentContextKey", "ear.context"); sc.setInitParameter("locatorFactorySelector", "classpath:common-beans.xml");