用ClassPathXmlApplicationContext读取配置文件,那么配置文件web/WEB-INF/classes下!
读取spring配置文件的方法有好几种,涉及到ClassPath的都把配置文件放到web/WEB-INF/classes下!
另外的方法:比如:
ApplicationContext ctx=new FileSystemXmlApplicationContext("bean.xml");
则需要把配置文件放到项目的根目录。

解决方案 »

  1.   

    f = FileSystemXmlApplicationContext(path+"/applicationContext.xml");
      

  2.   

    我也不知道这个,我将配置文件配置在WebRoot/WEB-INF/Spring(自己建的文件夹)/applicationContext-zjc.xml下;然后我使用
    ApplicationContext act = new FileSystemXmlApplicationContext("WebRoot/WEB-INF/Spring/applicationContext-zjc.xml"); 
    userService = (ISysUserService)act.getBean("sysUserService");
    return userService;
    怎么读都是系统找不该文件我也不知道问题出在那了!