maven整理项目spring配置文件加载问题

1,classpath:applicationContext.xml改为classpath*:applicationContext.xml 
这么写也是一样的效果:classpath*:/applicationContext.xml 
2,在applicationContext.xml引用其它的配置文件: 
如果在同一个jar包这么写, 

Java代码  

1
<import resource="classpath:/applicationContext-action.xml" />

要导入其它jar包中的配置文件,这么写 

Java代码  

1
<import resource="classpath*:/applicationContext-service.xml" />

就这么简单,重新打包、部署、启动成功。 

posted on 2017-01-10 19:44  老邱2  阅读(698)  评论(0编辑  收藏  举报

导航