Spring使用非applicationContext.xm 默认名的配置文件的配置
2024-10-16 14:59:28
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>
最新文章
- ubuntu分区
- 学习使用monkey 测试
- 微信小程序初体验(上)
- hdu1998 bjfu1272奇数阶幻方构造
- 用eval 动态编译代码
- keil #pragma disable
- 在 Linux 中自动生成 Cordova/Phonegap for Android 的 APK 安装程序
- aws部署从无到有
- openURL in APP Extension
- 【BZOJ2588】Count On a Tree(主席树)
- Vue基础(环境配置、内部指令、全局API、选项、内置组件)
- Java 多线程(五)—— 线程池基础 之 FutureTask源码解析
- 团队项目需求分析——NABCD
- H5 68-伪元素选择器
- java多线程快速入门(三)
- Hive SQL grouping sets 用法
- Go指南_切片的长度与容量
- [React] 09 - Tutorial: components
- Generic Realtime Intermediary Protocol
- 微信小程序笔记<;五>; 页面管理及生命周期(route)——getCurrentPages()
热门文章
- 如何让Notepad++添加Python运行方式.精讲
- Bash之PS1配置
- Oracle10g RAC关闭及启动步骤
- Imagenet tools install on windows
- 【Infobright】infobright数据导入导出测试
- MSSQL 多行合并为一行
- 如何在Ubuntu下的VirtualBox虚拟机(Windows XP)里挂载/使用U盘 (转载)
- [MongDB] 主从架构--官方极力不推荐
- WKWebview 拼接tableview,获取web内容高度
- TortoiseSvn客户端出现Http state 405 &#39;Method Not Allowed&#39; 的解决办法