PathMatchingResourcePatternResolver

PathMatchingResourcePatternResolver是一个通配符的Resource查找器,包括: 
/WEB-INF/*-context.xml 
com/mycompany/**/applicationContext.xml 
file:C:/some/path/*-context.xml 
classpath:com/mycompany/**/applicationContext.xml

    ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
         
        Resource[] resources = resolver.getResources("classpath:com/you/atlas/webx/context/*.class");
         
        System.out.println(resources[0].getURL());
echo:file:/home/work/branche/springtest/target/classes/com/you/atlas/webx/context/WebxContextLoader.class

spring SqlMapClientFactoryBean提供了一个setMappingLocations方法支持“/myApp/*-map.xml”,不用哭逼的增加一个sqlpmap就在xml文件加一条啊!

posted on 2013-04-08 17:58  dhj  阅读(512)  评论(0编辑  收藏  举报

导航