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

前端之家收集整理的这篇文章主要介绍了spring配置文件注解方式引入的两种方式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

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

二、${'propertiesName'}方式

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

 

猜你在找的Spring相关文章