Posted on 2016-11-03 18:17
skycity 阅读(234)
评论(0) 编辑 收藏
通过Application
ApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext();
classPath = classPathXmlApplicationContext.getResource("classpath:config.properties").getFile().getPath();
if(classPath.indexOf("WEB-INF")>0){
classPath = classPath.substring(0,classPath.indexOf("WEB-INF")+7)+"/classes/"+xmlFile;
}
Lyyb2001