Spring configuration in multi-module project

后端 未结 2 831
青春惊慌失措
青春惊慌失措 2021-02-05 22:13

I\'m new to Spring and got a situation that single project with multiple modules including one web module. Web module uses Spring MVC, but I was wondering if I can have main Spr

2条回答
  •  -上瘾入骨i
    2021-02-05 22:40

    We have this kind of architecture where I work. We decided to use the ContextLoaderListener (Spring Event Listener) in the web module.

    Then, in the serverApplicationContext.xml, we import all the modules context files :

    
    
    ...
    

    Thus you leverage the spring context loading during the web application context initialization.

提交回复
热议问题