util:properties和context:property-placeholder标签都可以用来获取外部配置文件中的内容
1、util:properties
它是以声明bean方式来使用,创建了一个bean,下面使用的时候通过SpEL表达式#{}获取bean的属性。
需要注意,这种方式需要在spring配置文件头部声明
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd"
2、context:property-placeholder
它是将配置文件加载至spring上下文中,然后通过${}取得值,常用于bean的属性上