Using multiple property files (via PropertyPlaceholderConfigurer) in multiple projects/modules

前端 未结 5 1072
情书的邮戳
情书的邮戳 2020-12-07 08:41

We are currently writing an application which is split into multiple projects/modules. For example, let\'s take the following modules:

  • myApp-DAO
  • myApp
5条回答
  •  失恋的感觉
    2020-12-07 08:42

    I tried the solution below, it works on my machine.

    
    
    
    

    In case multiple elements are present in the Spring context, there are a few best practices that should be followed:

    the order attribute needs to be specified to fix the order in which these are processed by Spring all property placeholders minus the last one (highest order) should have ignore-unresolvable=”true” to allow the resolution mechanism to pass to others in the context without throwing an exception

    source: http://www.baeldung.com/2012/02/06/properties-with-spring/

提交回复
热议问题