Skip to content

Latest commit

 

History

History
37 lines (32 loc) · 1.45 KB

File metadata and controls

37 lines (32 loc) · 1.45 KB

one-ear-multiple-wars-share-spring-contexts

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:

  1. modify web.xml war add: locatorFactorySelector classpath:common-beans.xml

  2. in common-beans.xml

    services-context1.xml services-context2.xml ... services-contextN.xml
    1. if use servlet 3 spring, in WebApplicationInitializer use sc.setInitParameter("parentContextKey", "ear.context"); sc.setInitParameter("locatorFactorySelector", "classpath:common-beans.xml");