spring读取XML配置文件的三种方式

方法一:

    String[] path={"WebRoot/WEB-INF/applicationContext.xml","WebRoot/WEB-INF/applicationContext_task.xml"};
 ApplicationContext context = new FileSystemXmlApplicationContext(path);

 

  方法二:

    String path="WebRoot/WEB-INF/applicationContext*.xml";
 ApplicationContext context = new FileSystemXmlApplicationContext(path);

  方法三:

    ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath:地址");

你可能感兴趣的:(spring读取XML配置文件的三种方式)