web.xml中的contextConfigLocation在spring中的作用
2023-09-11 14:14:57 时间
在web.xml中通过contextConfigLocation配置spring,
contextConfigLocation参数定义了要装入的 Spring 配置文件。默认会去/WEB-INF/下加载applicationContext.xml。
如果想装入多个配置文件,可以在 <param-value>
标记中用逗号作分隔符或通配符。
在web.xml里配置Listener
web.xml 代码如下:
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/app-*.xml</param-value> </context-param>
app-context.xml
<context:component-scan base-package="com.xdt.ibs" />
相关文章
- [Web 前端 ] 五大WEB主流浏览器及四大内核
- 云集,让 web app 像 native app 那样运行(雄起吧,Web 开发者)
- 《ASP.NET MVC4 WEB编程》学习笔记------Web API 续
- spring boot:创建一个简单的web(maven web project)
- spring 的OpenSessionInViewFilter简介
- Web 开发中 20 个很有用的 CSS 库 - WEB开发者
- Spring中使用RedisTemplate操作Redis(spring-data-redis)
- Spring配置中的"classpath:"与"classpath*:"的区别研究(转)
- 使用spring 4.0 + maven 构建超简单的web项目
- [Spring学习笔记 3 ] spring 注解详解,完全注解,常用注解
- spring aop环绕通知@Around
- Spring读源码系列番外篇09--BeanWrapper的应用
- Atitit.web三大编程模型 Web Page Web Forms 和 MVC
- 为什么Spring Boot推荐使用logback-spring.xml来替代logback.xml来配置logback日志的问题分析
- Spring只能注入接口,不能注入实现类
- React.js 集成 Kotlin Spring Boot 开发 Web 应用实例详解
- 毕业设计 Spring Boot的网上购物商城系统(含源码+论文)
- spring与mybatis集成和事务控制
- 【Spring注解驱动开发】BeanPostProcessor在Spring底层是如何使用的?看完这篇我懂了!!
- 014-Spring Boot web【三】拦截器HandlerInterceptor、异常处理页面,全局异常处理ControllerAdvice
- 谈谈对XML的理解?说明Web应用中Web.xml文件的作用?
- JavaEE——Spring学习笔记06【Maven创建Web工程】
- [spring学习]7、手写spring注解扫描机制
- 【java】Spring Boot --spring boot项目整合xxl-job