spring配置文件注解方式引入的两种方式

一、#{beanID['propertiesName']}方式

<bean id="propertyConfigurer"  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="fileEncoding" value="utf-8" />
        <property name="locations">
            <list>
                <value>classpath:/config/pay-alipay.properties</value>
            </list>
        </property>
</bean>
@Value("#{propertyConfigurer['workFlow.url']}") private String flowUrl;

二、${'propertiesName'}方式

@Value("${material.qrCode.target.url}")
private String qrCodeUrl;

 

posted @ 2017-03-27 18:31  旋转的梦  阅读(494)  评论(0编辑  收藏  举报