Can I compose a Spring Configuration File from smaller ones?

前端 未结 7 1926
后悔当初
后悔当初 2021-02-13 02:38

I have a handful of projects that all use one project for the data model. Each of these projects has its own applicationContext.xml file with a bunch of repetitive data stuff w

7条回答
  •  抹茶落季
    2021-02-13 03:13

    Here's what I've done for one of my projects. In your web.xml file, you can define the Spring bean files you want your application to use:

      
        contextConfigLocation
        
          /WEB-INF/applicationContext.xml
          /WEB-INF/modelContext.xml
          /WEB-INF/ui.xml
        
      
    

    If this isn't defined in your web.xml, it automatically looks for /WEB-INF/applicationContext.xml

提交回复
热议问题