初始化Spring容器-Spring入门

时间:2021-04-26 09:28:32
【文件属性】:
文件名称:初始化Spring容器-Spring入门
文件大小:903KB
文件格式:PPT
更新时间:2021-04-26 09:28:32
Spring入门 初始化Spring容器: 方式一:在类路径下寻找配置文件来实始化容器 方式二:在文件系统路径下寻找配置文件来实始化容器 建议使用第一种方式 使用多个配置文件时需要使用字符串数组 ApplicationContext ctx=new ClassPathXmlApplicationContext(new String[]{"aa.xml","bb,xml"}); ApplicationContext ctx=new FileSystemPathXmlApplicationContext( new String[]{"c:\\aa.xml","c:\\b.xml"});

网友评论