Skip to content

Instantly share code, notes, and snippets.

@aliencode
Last active December 22, 2015 08:39
Show Gist options
  • Select an option

  • Save aliencode/6446724 to your computer and use it in GitHub Desktop.

Select an option

Save aliencode/6446724 to your computer and use it in GitHub Desktop.
Spring context:property-placeholder 加载顺序和覆盖

##设定加载顺序,数字大的优先加载

<context:property-placeholder location="classpath*:/context2.properties" order="0"/>
<context:property-placeholder location="classpath*:/context.properties" order="100"/>

context2.properties将覆盖context.properties中的值。

##覆盖其它properties

<context:property-override location="classpath:override.properties"/>

##参考 http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/htmlsingle/spring-framework-reference.html#beans-factory-overrideconfigurer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment