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

获取后缀文件

    <!-- 注解读取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文件结束 -->

 

posted @ 2016-05-24 10:47  ice.ko  阅读(436)  评论(0编辑  收藏  举报