posts - 88, comments - 3, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Spring中classpath与classpath*的区别

Posted on 2016-05-26 14:14 Milo的海域 阅读(751) 评论(0)  编辑  收藏 所属分类: Java
http://stackoverflow.com/questions/3294423/spring-classpath-prefix-difference



  

SIMPLE DEFINITION

The classpath*:conf/appContext.xml simply means that all appContext.xml files under conf folders in all your jars on the classpath will be picked up and joined into one big application context.

In contrast
, classpath:conf/appContext.xml will load only one such file the first one found on your classpath.


<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:*.properties</value>
<value>classpath*:*.properties</value>
</list>
</property>
</bean>


只有注册用户登录后才能发表评论。


网站导航: