在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标签的含义的更多相关文章

  1. web.xml中<security-constraint>安全认证标签说明

      1.security-constraint元素 部署描述符中的<security-constraint>元素允许不通过编程就可以限制对某个资源的访问. <security-con ...

  2. 在web.xml中可以设置jsp标签吗?

    <jsp-config> <taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> ...

  3. Web.xml中Filter过滤器标签几个说明

    在研究liferay框架中看到Web.xml中加入了过滤器的标签,可以根据页面提交的URL地址进行过滤,发现有几个新标签没用过,下面就介绍以下几个过滤器的标签用法: <!-- 定义Filter ...

  4. Tomcat6和7版本对web.xml中taglib标签的配置差异

    原来部署在Tomcat6中的应用在Tomcat7中运行时报错如下错误: java.lang.IllegalArgumentException: taglib definition not consis ...

  5. web.xml中Filter过滤器标签说明

    原文:http://www.cnblogs.com/edwardlauxh/archive/2010/03/11/1918618.html 在研究liferay框架中看到Web.xml中加入了过滤器的 ...

  6. SpringMVC: web.xml中声明DispatcherServlet时一定要加入load-on-startup标签

    游历SpringMVC源代码后发现,在web.xml中注冊的ContextLoaderListener监听器不过初始化了一个根上下文,只完毕了组件扫描和与容器初始化相关的一些工作,并没有探測到详细每一 ...

  7. SpringMVC: web.xml中声明DispatcherServlet时一定要添加load-on-startup标签

    游历SpringMVC源码后发现,在web.xml中注册的ContextLoaderListener监听器只是初始化了一个根上下文,仅仅完成了组件扫描和与容器初始化相关的一些工作,并没有探测到具体每个 ...

  8. web.xml中servlet mapping标签

    写了好多小项目后也没弄明白<url-pattern>的真正意义,写跳转的时候也是跳的三心二意的,今天查了一下web.xml的详细配置,看了看servlet-mapping的讲解,豁然开朗, ...

  9. web.xml中的welcome-file-list标签作用

    welcome-file-list是一个配置在web.xml中的一个欢迎页,用于当用户在url中输入项目名称或者输入web容器url(如http://localhost:8080/)时直接跳转的页面. ...

  10. web.xml中load-on-startup

    <servlet> <servlet-name>SystemInit</servlet-name> <servlet-class>sjgl.system ...

随机推荐

  1. linux上安装hadoop

    机器准备 物理机器 总 共4台,想配置基于物理机的hadoop集群中包括 4 个 节点: 1 个 Master , 3 个 Salve , 节点之间局域网连接,可以相互 ping 通Ip分布 为192 ...

  2. NSArray,NSSet,NSDictionary的遍历,基本使用集锦

    NSArray *array = [NSArray arrayWithObjects:@"zhangsan",@"lisi",@"wangwu&quo ...

  3. codeforces 711C Coloring Trees(DP)

    题目链接:http://codeforces.com/problemset/problem/711/C O(n^4)的复杂度,以为会超时的 思路:dp[i][j][k]表示第i棵数用颜色k涂完后bea ...

  4. 20145210 《Java程序设计》第07周学习总结

    教材学习内容总结 第十二章 Lambda 12.1 认识Lambda语法 •Lambda 教材的引入循序渐近.深入浅出 •如果使用JDK8的话,可以使用Lambda特性去除重复的信息,例: Compa ...

  5. 第一次进div1了

    第一次进div1~好激动啊! 上帝依旧那么眷顾我!

  6. Selenium - 实现网页元素拖拽

    Drag and Drop, 使用鼠标实现元素拖拽的操作貌似很复杂, 在Selenium中, 借助OpenQA.Selenium.Interactions.Actions类库中提供的方法, 实现起来还 ...

  7. 解决spring配置中的bean类型的问题:BeanNotOfRequiredTypeException

    解决spring配置中的bean类型的问题:BeanNotOfRequiredTypeException这个问题出现的原因:一般在使用annotation的方式注入spring的bean 出现的,具体 ...

  8. csdn第四名

    编号:1027时间:2016年7月18日11:10:42功能:csdn第四名URL :http://blog.csdn.net/yuanmeng001

  9. 添加mongodb支持

    最近花了些时间,将引擎的存储换成了mongodb. 私下,我觉得现有的存储机制极为落后.现在写数据的操作交由单独的进程完成,该进程兼当数据缓冲与持续化数据的责任.此次引擎的更换,只是简单的利用mong ...

  10. JQuery中操作Css样式

    //1.获取和设置样式 $("#tow").attr("class")获取ID为tow的class属性 $("#two").attr(&qu ...