使用 applicationContext.getResource(“classpath:文件名”):在src根目录下,在类路径下 applicationContext.getResource(“classpath:/chap01/文件名”): 以src根目录下的基准往下走。 applicationContext.getResource(“file:c:/a.properties”):在系统文件目录下。