HTML Code
1 2345678910 | <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"/> |
HTML Code
1 234 | # default.properties file content local.p_w_upload.path=1p_w_upload.resume.path=2interview.p_w_upload.path=D:\My Document |
Java Code
1 234567891011121314151617181920212223242526272829 | /** * PathConfig 注入的类文件 * * @author Tony.Wang * @time 2014/4/28 0028 17:31 */ public class PathConfig { @Value("${local.p_w_upload.path}") private String localAttachmentPath; @Value("${p_w_upload.resume.path}") private String p_w_uploadResumePath; @Value("${interview.p_w_upload.path}") private String interviewAttachmentPath; public String getLocalAttachmentPath() { return localAttachmentPath; } public String getInterviewAttachmentPath() { return interviewAttachmentPath; } public String getAttachmentResumePath() { return p_w_uploadResumePath; }} |
Java Code
1 2 | @Resource private PathConfig pathConfig; |