您的位置:首页 > 编程语言 > Java开发

【日常笔记】java spring 注解读取文件

2016-05-24 10:47 531 查看
获取后缀文件

<!-- 注解读取properties文件开始 @Value("#{configProperties['userPageSize']}")private
String userPageSize; -->
<bean id="configProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="locations">
<list>
<value>classpath:/config/*.properties</value>
</list>
</property>
</bean>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
<property name="properties" ref="configProperties" />
</bean>
<!-- 注解读取properties文件结束 -->
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: