maven整理项目spring配置文件加载问题
Posted 老邱2
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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" /> |
就这么简单,重新打包、部署、启动成功。
以上是关于maven整理项目spring配置文件加载问题的主要内容,如果未能解决你的问题,请参考以下文章