将web02项目配置上spring--applicationContext.xml
来源:互联网 发布:淘宝店运营方案 编辑:程序博客网 时间:2024/04/30 12:37
jar包不用新添加,使用原来web02添加的jar就够了,添加applicationContext文件进来只需再web.xml文件中添加一个监听器即可
添加代码如下:
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 默认配置在WEB-INF目录下 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> <!-- <param-value>/WEB-INF/spring*.xml</param-value> --> </context-param>
这里遇到过这样一个面试题:什么是监听器、什么是过滤器,什么是拦截器;
监听器是注册再web.xml文件中的,监听一些事件的发生,比如ContextLoaderListener 实现了servletContextListener,它能够监听 ServletContext 对象的生命周期,实际上就是监听 Web 应用的生命周期。
显然ContextLoaderListener是监听web项目启动事件的,web启动就去加载applicationContext文件。
0 0
- 将web02项目配置上spring--applicationContext.xml
- spring applicationContext.xml配置
- spring applicationContext.xml配置
- Spring applicationContext.xml配置详解
- spring ApplicationContext.xml配置mybatis
- spring applicationContext.xml 基本配置
- Spring的applicationContext.xml配置
- spring applicationcontext.xml配置分析
- Spring-applicationContext.xml路径配置
- Spring beans.xml(applicationContext.xml) 配置
- spring web.xml applicationContext.xml常见配置
- spring+hibernate之applicationContext.xml配置
- spring+hibernate之applicationContext.xml配置
- Spring的applicationcontext.xml配置解释
- spring applicationContext.xml的一些基本配置
- Spring的配置文档applicationContext.xml
- spring使用AOP如何配置ApplicationContext.xml
- Spring的applicationContext.xml常用配置
- Codeforces 349C Mafia【二分+思维判定】
- 1001. 害死人不偿命的(3n+1)猜想 (15)
- 蛋白质结构预测(swiss-model,modeller )
- node中https请求
- 第七届蓝桥杯大赛个人赛省赛(软件类)A组第三题 方格填数
- 将web02项目配置上spring--applicationContext.xml
- Servlet中的HttpServletRequest
- C++四种类型转换机制
- block块对象
- String类详解
- [kuangbin带你飞]专题一 简单搜索 F
- [构造 哈密顿路径] SRM 704 div1 HamiltonianConstruction
- EventBus
- 神经网络激活函数的介绍