spring bean中注入属性文件中的值
bean中
@Value("${email.toUsers}")
private String toUsers;
属性文件email.properties中
email.toUsers=yangzhen@baidu.com,tianyongqian@baidu.com
配置文件中
<bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:email.properties</value>
</list>
</property>
</bean>