在FileSystemResource 中需要给出spring-config.xml 文件在你项目中的相对路径或者绝对路径。在ClassPathResource 中spring 会在ClassPath 中自动搜寻配置文件,所以要把ClassPathResource 文件放在ClassPath 下。
如果将spring-config.xml 保存在了src 文件夹下的话,只需给出配置文件的名称即可,因为src 文件夹是默认。
简而言之,ClassPathResource 在环境变量中读取配置文件,FileSystemResource 在配置文件中读取配置文件。