web.xml的启动顺序
1. context-param
2. Listener
3. Filter
4. servlet
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name></display-name> <!-- 配置spring用于初始化容器对象的监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext*.xml</param-value>
</context-param>
<!-- 用于初始化工作的监听器, 一定要配置到spring监听器的后面 -->
<listener>
<listener-class>cn.itcast.oa.util.InitListener</listener-class>
</listener> <!-- 配置spring的用于解决懒加载问题的过滤器 -->
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<!-- 配置struts2的核心过滤器 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
web.xml的启动顺序的更多相关文章
- web.xml加载顺序
一 1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个Ser ...
- JAVA Web.xml 加载顺序
web.xml加载过程(步骤): 1.启动WEB项目的时候,容器(如:Tomcat)会去读它的配置文件web.xml.读两个节点: <listener></listener> ...
- Java web.xml加载顺序
web.xml加载过程(步骤): 1.启动WEB项目的时候,容器(如:Tomcat)会去读它的配置文件web.xml.读两个节点: <listener></listener&g ...
- web.xml加载顺序详解
一. 1.启动tomcat启动web项目,首先读取web.xml文件中<context-param>和<listener> 2.容器创建一个ServletContext(ser ...
- web.xml加载顺序 [转载]
一 1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个Ser ...
- 【未整理】web.xml加载顺序.RP
一 1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个Ser ...
- 通过web.xml监听器启动main方法
web.xml中添加要启动的类 <listener> <listener-class>server.NettyServer</listener-class> < ...
- web.xml的运行顺序
整体上的顺序为 <context-param> <listener> <filter> <servlet> 往下依次运行. 当中,每一个类别内部都是按序 ...
- web.xml 加载顺序
参考网址: 上下文对象>监听>过滤器>servlet 1.先加载上下文对象 <!-- 初始化Spring classpath*:spring/applicationContex ...
随机推荐
- repeat a string in java
if I want to repeat "hello" four times as a new string-> "hellohellohellohello&quo ...
- Angularjs Directive(指令)机制
转:http://damoqiongqiu.iteye.com/blog/1917971 1.一点小说明 指令的作用:实现语义化标签 我们常用的HTML标签是这样的: <div> < ...
- 当@PathVariable遇上中文和点
当@PathVariable遇上中文和点 Spring MVC从3.0开始支持REST,而主要就是通过@PathVariable来处理请求参数和路径的映射. 由于考虑到SEO的缘故,很多人喜欢把新闻 ...
- asp.net控件ControlToValidate同OnClientClick冲突解决办法
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Error ...
- hadoop运行作业的脚本解析
#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one or more # contribut ...
- 10款超酷实用的jQuery焦点图赏析及源码
1.jquery整屏滚动插件Scrollify Scrollify是一个jQuery插件协助整屏滚动和顺利拍摄部分.完全可配置和优化. 在线演示 源码下载 2.jquery实现网易邮箱页面插件full ...
- PHP5.4 for Apache, php 5.4.0安装过程、方法、配置 ; Apache2.2支持php5.4的配置方法
那我们如何选择下载哪个版本的PHP呢?如果你是在windows下使用Apache+PHP的,请选择VC6版本:如果你是在windows下使用IIS+PHP的,请选择VC9版本. 二.如何选择PHP5. ...
- gvim work notes.. a few days' work on 64bit vim and plugin compilations
(a 600MB+ sized c/c++ compiler which is capable of hi-light and JB styled completion!! and of-course ...
- Loadrunner性能测试分类详(二)
一.基准测试 有基础的标准,这样能通过对比发现系统的不同点与变化. 1.可以再指定的标准下通过基准测试建立一个性能基准,这样以后当系统的环境.参数发生变化后,再进行一次相同标准下的测试,即可看出变化对 ...
- 模版引擎Handlebars语法(1)
<script src="handlebars.js"></script></head><body> <div id=&quo ...