0
我正嘗試形式XML遷移到註釋此代碼:從XML遷移到註釋(春季)
<bean
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="ignoreResourceNotFound" value="true" />
<property name="locations">
<list>
<value>classpath:spring/file1.properties</value>
<value>file:${file.prop}</value>
</list>
</property>
</bean>
我不知道如何遷移的地址的列表,我要創建的陣列資源(資源[]),但我如何遷移每個值?
@Bean
public PropertiesFactoryBean fieldNamesProperties() {
PropertiesFactoryBean fieldNamesProperties = new PropertiesFactoryBean();
fieldNamesProperties.setIgnoreResourceNotFound(true);
Resource[] locations = new Resource[2];
// TODO add resources
fieldNamesProperties.setLocations(locations);
return fieldNamesProperties;
}