日期:2014-05-20 浏览次数:20665 次
ApplicationContext context = new FileSystemXmlApplicationContext(System.getProperty("user.dir") + "\\applicationContext.xml");
PropertyConfigurator.configure(System.getProperty("user.dir") + "\\log4j.properties");
1)System.getProperty("user.dir") 2)或者String url = this.getClass().getClassLoader().getResource("/").toString(); url = url.substring(0, url.length() - 8);
<context:component-scan base-package="com.xxx.xxx" />