[转]Servlet的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.
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/enjoyo/archive/2007/08/27/1761033.aspx
EG:
<servlet>
<servlet-name>LogIniter</servlet-name>
<servlet-class>com.init.LogIniter</servlet-class>
<init-param>
<param-name>log4j</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>DicDataIniter</servlet-name>
<servlet-class>com.init.DicDataIniter</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>LogIniter</servlet-name>
<url-pattern>/LogIniter</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DicDataIniter</servlet-name>
<url-pattern>/DicDataIniter</url-pattern>
</servlet-mapping>
[转]Servlet的load-on-startup的更多相关文章
- Spring boot 全局配置文件application.properties
#更改Tomcat端口号 server.port=8090 #修改进入DispatcherServlet的规则为:*.htmlserver.servlet-path=*.html#这里要注意高版本的s ...
- SpringBoot 全配置(推荐收藏)
# =================================================================== # COMMON SPRING BOOT PROPERTIE ...
- SpringBoot 之 MVC
SpringBoot MVC 和静态资源 首先,我们一定要搞清楚,mvc 配置和 static 配置的联系和区别. mvc 配置其实就是给 spring mvc 框架用的, 具体来说, 比如 @Req ...
- sprint boot 配置
来源:https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-configure-to ...
- spring boot的默认配置
# BANNER banner.charset=UTF- # Banner file encoding. banner.location=classpath:banner.txt # Banner f ...
- Servlet 工作原理解析
转自:http://www.ibm.com/developerworks/cn/java/j-lo-servlet/ Web 技术成为当今主流的互联网 Web 应用技术之一,而 Servlet 是 J ...
- JavaWeb总结--Servlet 工作原理解析
从 Servlet 容器说起 要介绍 Servlet 必须要先把 Servlet 容器说清楚,Servlet 与 Servlet 容器的关系有点像枪和子弹的关系,枪是为子弹而生,而子弹又让枪有了杀伤力 ...
- Servlet容器的启动过程
[http://book.51cto.com/art/201408/448854.htm] Tomcat的启动逻辑是基于观察者模式设计的,所有的容器都会继承Lifecycle接口,它管理着容器的整 ...
- [转]Servlet 工作原理解析
Web 技术成为当今主流的互联网 Web 应用技术之一,而 Servlet 是 Java Web 技术的核心基础.因而掌握 Servlet 的工作原理是成为一名合格的 Java Web 技术开发人员的 ...
- Servlet 工作原理解析--转载
原文:http://www.ibm.com/developerworks/cn/java/j-lo-servlet/index.html?ca=drs- Web 技术成为当今主流的互联网 Web 应用 ...
随机推荐
- Django【设计】settings方案
配置文件: 目标:配置文件,默认配置和手动配置分开,参考django的配置文件方案,默认配置文件放在内部,只让用户做常用配置 /bin/settings.py(手动配置) PLUGIN_ITE ...
- vim查找/替换字符串【转】
转自:http://www.cnblogs.com/GODYCA/archive/2013/02/22/2922840.html vi/vim 中可以使用 :s 命令来替换字符串.该命令有很多种不同细 ...
- 独立服务器远程重装Linux系统
独立服务器远程重装Linux系统 http://rashost.com/blog/remote-reinstall-linux-dedicated-server 本文介绍怎样在没有console连接, ...
- MariaDB 复合语句和优化套路
测试环境准备 本文主要围绕的对象是mariadb 高级语法, 索引优化, 基础sql语句调优. 下面那就开始搭建本次测试的大环境. 首先下载mariadb开发环境, 并F5 run起来. 具体参照 ...
- python 使用国内源安装软件
python linux 等 使用国内源安装软件 速度更快 你值得拥有 ! 豆瓣源:pip install -i https://pypi.douban.com/simple/ 阿里源:pip ins ...
- 【Spring事务的事务属性】
大家都知道,Spring的声明式事务是通过事务属性来定义的,而spring的事务属性包含了5个方面:传播行为,隔离级别,是否只读,事务超时,回滚规则: 传播行为 传播行为,是属于事务边界相关的属性,定 ...
- 同步方法-java
除了同步代码块能实现同步执行外,同步方法也可以. 先看下同步代码块实现同步执行: public class Demo4 { public static void main(String[] args) ...
- 2:django models Making queries
这是后面要用到的类 class Blog(models.Model): name = models.CharField(max_length=100) tagline = models.TextFie ...
- java常用设计模式学习心得
学习自:http://shenzhenchufa.blog.51cto.com/730213/161581 代码来自:http://shenzhenchufa.blog.51cto.com/73021 ...
- LeetCode解题报告—— 4Sum & Remove Nth Node From End of List & Generate Parentheses
1. 4Sum Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + ...