spring配置文件的通配符

?代表匹配任意一个字符          

 *代表匹配0个或多个任意字符            **/匹配任意多个目录

classpath:app-Beans.xml

查找app-Beans.xml,无匹配符需要完全匹配

classpath:App?-Beans.xml

匹配任意一个字符,比如App1-Beans.xml,App2-Beans.xml

classpath:user/*/Base-Beans.xml

匹配0个或多个字符串,比如user/1/Base-Beans.xml,user/2/Base-Beans.xml,不匹配user/Base-Beans.xml

classpath:user/**/Base-Beans.xml

匹配0个或多个目录,比如user/a/b/Base-Beans.xml,匹配user/Base-Beans.xml

classpath:**/*-Beans.xml

查找所有路径下以-Beans.xml结尾的配置文件进行加载,比如ab-Beans.xml,但重复的文件名只加载一次

classpath*:user/**/*-Beans.xml

classpath*加载多个配置文件,即使重名也要加载,查找user目录下任意多个目录中-Beans.xml结尾的配置文件进行加载

你可能感兴趣的:(spring,spring通配符)