@Component
public class BaseConfigPath {
private static final String configPath = System.getProperty("user.home")+"/code/config";
public String getConfigPath() {
return configPath;
}
}
根据配置文件路径解析properties
<context:property-placeholder location="file:#{baseConfigPath.configPath}/jdbc.properties"/>
获取properties的属性值
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
原文地址:http://blog.51cto.com/12165865/2178860
时间: 2024-11-06 18:31:43