Spring 自定义注解注入properties文件的值jar包,下面为使用方法
在xml配置文件中,这样加载properties文件
<bean id="propertyConfigurer" class="com.better517na.propertiesComponent.business.ExtendedPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:com/better517na/config/jdbc.properties</value> </list>
</property>
</bean>
然后,在需要注入的地方这样
@Config("timeslice")
private String timeslice;