spring中ClassPathXmlApplicationContext 和FileSystemXmlApplicationContext的区别

来源:互联网 发布:宽带网络套餐十机顶盒 编辑:程序博客网 时间:2024/05/21 14:54
1.ClassPathXmlApplicationContext(),classpath:前缀是不需要的,默认就是指项目的classpath路径下面;

如果要使用绝对路径,需要加上 file:前缀表示这是绝对路径;

2.对于FileSystemXmlApplicationContext(),默认表示的是两种:
没有盘符的是 项目工作路径,即项目的根目录;
有盘符表示的是 文件绝对路径.

如果要使用classpath路径,需要前缀 classpath:.

0 0