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 ...
随机推荐
- LeetCode OJ 110. Balanced Binary Tree
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary ...
- 第4章 流程控制----编写Java程序,使用while循环语句计算1+1/2!+1/3!+...+1/20!之和
package four; public class fouronetwo { public static void main(String args[]){ double sum = 0,a = 1 ...
- webstrom管理git
先写一段 webstrom文件名变色:1.绿色的文件添加 2.蓝色的原有文件修改 如果出现““No such file or directory”或类似的语句,说明缺少ssh的key.那么我们就得创建 ...
- a标签无跳转的死链接
<a href="#" onclick="return false;">link1</a> <a href="javas ...
- dp + 组合数 Codeforces Beta Round #9 (Div. 2 Only) D
http://codeforces.com/problemset/problem/9/D 题目大意:给你一个二叉树和n个数字,满足左小右大,能形成多少种不同的二叉树 思路:定义dp[i][j]表示目前 ...
- centos7配置ip
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 ONBOOT=yes 重启ip服务 systemctl restart network.service 开 ...
- Object调用控件的办法
<OBJECT id="pwdpad" style="LEFT: 0px; WIDTH: 35px; TOP: 0px; HEIGHT: 16px" cl ...
- 2.10 工具使用 after effects(图形视频处理软件)
................... ..................... 暂无 教程素材网 http://img.yipinsucai.com/
- linux C++通过ntp协议获取网络时间
转自:http://blog.csdn.net/ccjjyy/article/details/42871993 #include <stdio.h> #include <sys/ty ...
- 7--OC中NSLog函数输出格式详解
OC中NSLog函数输出格式详解 • %@ 对象 • %d, %i 整数 • %u 无符整形 • %f 浮点/双字 • %x, %X 二进制整数 • %o 八进制整数 • %zu size_t • % ...