现在的位置: 首页 > 综合 > 正文

ClassPathXmlApplicationContext和FileSystemXmlApplicationContext的路径设置、classpath

2013年09月04日 ⁄ 综合 ⁄ 共 286字 ⁄ 字号 评论关闭

http://blog.csdn.net/shendl/archive/2005/11/03/521701.aspx

 

 

对于ClassPathXmlApplicationContext(),classpath:前缀是不需要的,默认就是指项目的classpath路径下面;
如果要使用绝对路径,需要加上 file:  前缀表示这是绝对路径;
对于FileSystemXmlApplicationContext(),默认表示的是两种:
   1,没有盘符的是项目工作路径,即项目的根目录;
   2,有盘符表示的是文件绝对路径。
如果要使用classpath路径,需要前缀classpath:

 

抱歉!评论已关闭.