Spring默认的配置文件是applicationContext.xml,但是有些时候,希望拆分Spring的配置文件,让其单一化,每一个都只进行自己的配置,如图所示

那么就需要在web.xml中配置自定义的spring配置文件名称了

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-all.xml</param-value>
</context-param>

这样就指定了自定义的配置文件名称。

同时不要忘记设置spring容器的监听器哦~

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

最新文章

  1. ubuntu分区
  2. 学习使用monkey 测试
  3. 微信小程序初体验(上)
  4. hdu1998 bjfu1272奇数阶幻方构造
  5. 用eval 动态编译代码
  6. keil #pragma disable
  7. 在 Linux 中自动生成 Cordova/Phonegap for Android 的 APK 安装程序
  8. aws部署从无到有
  9. openURL in APP Extension
  10. 【BZOJ2588】Count On a Tree(主席树)
  11. Vue基础(环境配置、内部指令、全局API、选项、内置组件)
  12. Java 多线程(五)—— 线程池基础 之 FutureTask源码解析
  13. 团队项目需求分析——NABCD
  14. H5 68-伪元素选择器
  15. java多线程快速入门(三)
  16. Hive SQL grouping sets 用法
  17. Go指南_切片的长度与容量
  18. [React] 09 - Tutorial: components
  19. Generic Realtime Intermediary Protocol
  20. 微信小程序笔记&lt;五&gt; 页面管理及生命周期(route)——getCurrentPages()

热门文章

  1. 如何让Notepad++添加Python运行方式.精讲
  2. Bash之PS1配置
  3. Oracle10g RAC关闭及启动步骤
  4. Imagenet tools install on windows
  5. 【Infobright】infobright数据导入导出测试
  6. MSSQL 多行合并为一行
  7. 如何在Ubuntu下的VirtualBox虚拟机(Windows XP)里挂载/使用U盘 (转载)
  8. [MongDB] 主从架构--官方极力不推荐
  9. WKWebview 拼接tableview,获取web内容高度
  10. TortoiseSvn客户端出现Http state 405 &#39;Method Not Allowed&#39; 的解决办法