Posted on 2016-11-03 18:17
skycity 閱讀(245)
評(píng)論(0) 編輯 收藏
通過(guò)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