<bean id="ckcPlaceholderProperties" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:default.properties</value>
</list>
</property>
<property name="order" value="2"></property>
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>
<bean id="pathConfig" class="com.movitech.erms.business.configuration.PathConfig"/>
# default.properties file content
local.attachment.path=1
attachment.resume.path=2
interview.attachment.path=D:\My Document
/**
* PathConfig 注入的类文件
*
* @author Tony.Wang
* @time 2014/4/28 0028 17:31
*/
public class PathConfig { @Value("${local.attachment.path}")
private String localAttachmentPath; @Value("${attachment.resume.path}")
private String attachmentResumePath; @Value("${interview.attachment.path}")
private String interviewAttachmentPath; public String getLocalAttachmentPath() {
return localAttachmentPath;
} public String getInterviewAttachmentPath() {
return interviewAttachmentPath;
} public String getAttachmentResumePath() {
return attachmentResumePath;
}
}
@Resource
private PathConfig pathConfig;