web.xml中load-on-startup标签的含义
在servlet的配置当中,<load-on-startup>5</load-on-startup>的含义是:
标记容器是否在启动的时候就加载这个servlet。
当值为0或者大于0时,表示容器在应用启动时就加载这个servlet;
当是一个负数时或者没有指定时,则指示容器在该servlet被选择时才加载。
正数的值越小,启动该servlet的优先级越高。
Servlet specification:
The load-on-startup element indicates that this servlet should be loaded (instantiated and have its init() called) on the startup of the web application. The optional contents of these element must be an integer indicating the order in which the servlet should be loaded. If the value is a negative integer, or the element is not present, the container is free to load the servlet whenever it chooses. If the value is a positive integer or 0, the container must load and initialize the servlet as the application is deployed. The container must guarantee that servlets marked with lower integers are loaded before servlets marked with higher integers. The container may choose the order of loading of servlets with the same load-on-start-up value.
example:
<servlet>
<servlet-name>initservlet</servlet-name>
<servlet-class>com.bb.eoa.util.initServlet</servlet-class>
<init-param>
<param-name>log4j-init-file</param-name>
<param-value>config/log.properties</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
web.xml中load-on-startup标签的含义的更多相关文章
- web.xml中<security-constraint>安全认证标签说明
1.security-constraint元素 部署描述符中的<security-constraint>元素允许不通过编程就可以限制对某个资源的访问. <security-con ...
- 在web.xml中可以设置jsp标签吗?
<jsp-config> <taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> ...
- Web.xml中Filter过滤器标签几个说明
在研究liferay框架中看到Web.xml中加入了过滤器的标签,可以根据页面提交的URL地址进行过滤,发现有几个新标签没用过,下面就介绍以下几个过滤器的标签用法: <!-- 定义Filter ...
- Tomcat6和7版本对web.xml中taglib标签的配置差异
原来部署在Tomcat6中的应用在Tomcat7中运行时报错如下错误: java.lang.IllegalArgumentException: taglib definition not consis ...
- web.xml中Filter过滤器标签说明
原文:http://www.cnblogs.com/edwardlauxh/archive/2010/03/11/1918618.html 在研究liferay框架中看到Web.xml中加入了过滤器的 ...
- SpringMVC: web.xml中声明DispatcherServlet时一定要加入load-on-startup标签
游历SpringMVC源代码后发现,在web.xml中注冊的ContextLoaderListener监听器不过初始化了一个根上下文,只完毕了组件扫描和与容器初始化相关的一些工作,并没有探測到详细每一 ...
- SpringMVC: web.xml中声明DispatcherServlet时一定要添加load-on-startup标签
游历SpringMVC源码后发现,在web.xml中注册的ContextLoaderListener监听器只是初始化了一个根上下文,仅仅完成了组件扫描和与容器初始化相关的一些工作,并没有探测到具体每个 ...
- web.xml中servlet mapping标签
写了好多小项目后也没弄明白<url-pattern>的真正意义,写跳转的时候也是跳的三心二意的,今天查了一下web.xml的详细配置,看了看servlet-mapping的讲解,豁然开朗, ...
- web.xml中的welcome-file-list标签作用
welcome-file-list是一个配置在web.xml中的一个欢迎页,用于当用户在url中输入项目名称或者输入web容器url(如http://localhost:8080/)时直接跳转的页面. ...
- web.xml中load-on-startup
<servlet> <servlet-name>SystemInit</servlet-name> <servlet-class>sjgl.system ...
随机推荐
- linux上安装apache
1 安装aprtar -zxvf apr-1.4.2.tar.gz cd apr-1.4.2.tar.gz ./configure --prefix=/usr/local/aprmake & ...
- 使用copy来拷贝对象
拷贝对象 您通过将 copy 消息发送给对象,以制作对象的副本. NSArray *myArray = [yourArray copy]; 要拷贝,接收对象的类必须遵守 NSCopying 协议.如果 ...
- java作业7
(1)阅读以下代码(CatchWho.java),写出程序运行结果: (2)写出CatchWho2.java程序运行的结果 (3)请先阅读 EmbedFinally.java示例,再运行它,观察其输出 ...
- 9、SQL基础整理(两表连接exists,join on,union)
exists的用法 select *from haha where exists (select *from bumen where bumen.code = haha.bumen and bumen ...
- 超链接访问过后hover样式就不出现的问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xht ...
- SQL基础,与数据类型;
net start mssqlserver 开启数据库: net stop mssqlserver 关闭数据库: net pause mssqlserver 暂停数据库: net continu ...
- 游戏buff设计参见
其实这类帖子并没有多少的设计理论,对于策划的提升和帮助也并不大,原因其实在于其适用性太窄,当我要设计XX象棋的时候,它就滚一边去了. 废话不多说切入正题: 游戏中的BUFF/DEBUFF我们见过很多, ...
- [转】HTTP请求流程(二)----Telnet模拟HTTP请求
转自: http://www.cnblogs.com/stg609/archive/2008/07/06/1237000.html 上一部分"流程简介", 我们大致了解了下HTTP ...
- hihoCoder #1246 : 王胖浩与环 (数学)
题意: 有一个环形序列,可以将其切成连续的k段子序列,那么gcd( 每段子序列的和 )就是优美程度.输出n个整数,表示当k=[1, n] 时的最大优美程度. 思路: 观察一下,当切成1段的时候,gcd ...
- eclipse关联源码 Failed to create the part's controls
在eclipse中关联源码时: 1.出现Failed to create the part's controls错误, 2.而attach source 这个按钮却没有出现. 问题原由:eclipse ...