Can I compose a Spring Configuration File from smaller ones?

前端 未结 7 1948
后悔当初
后悔当初 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:08

    Yes, you can using the tag inside the "Master" bean file. But what about the why? Why not listing the files in the contextConfigLocation context param of the wab.xml or als locations array of the bean factory?

    I think mutliple files are much easier to handle. You may choose only some of them for a test, simply add rename or remove a part of the application and you may boundle different applications with the same config files (a webapp and a commandline version with some overlapping bean definitions).

提交回复
热议问题