【日常笔记】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文件结束 -->