Spring 资源加载-通配符之classpath*:

2019-06-11  本文已影响0人  AlanSun2

classpath*: vs classpath:?

它内部本质上使用了ClassLoader.getResources(...)方法。

举个例子:

ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath*:spring-beans.xml");
ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath:spring-beans.xml");
上一篇下一篇

猜你喜欢

热点阅读