实例化spring容器时间:2023-03-08 23:17:18 方法一:在类路径下寻找配置来实例化容器 ApplicationContext ctx = new String[]{"beans.xml"}); 方法二:在文件系统路径下寻找配置文件来实例化容器 ApplicationContext ctx = new String[]{"d:\\beans.xml"}); Spring的配置文件可以指定多个,通过string数组传入