`
zhanshenny
  • 浏览: 260273 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

web.xm中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> 
分享到:
评论

相关推荐

    javaWEB总结(2): load-on-startup节点

    load-on-startup节点的试验代码,详情请参考博文:http://blog.csdn.net/daochuwenziyao/article/details/53026185

    详解servlet配置load-on-startup的作用

    本文对load-on-startup的相关内容作了详细介绍,然后通过具体实例向大家展示了其作用,希望可以给大家一个参考。

    wget-1.11.4-1

    --load-cookies=FILE load cookies from FILE before session. --save-cookies=FILE save cookies to FILE after session. --keep-session-cookies load and save session (non-permanent) cookies. --post-data...

    windows版wget命令

    -r, --recursive recursive web-suck -- use with care!. -l, --level=NUMBER maximum recursion depth (0 to unlimit). --delete-after delete downloaded files. -k, --convert-links convert non-relative...

    Fluent12.0 help

    1.1.5 Command Line Startup Options . . . . . . . . . . . . . . . . . . 1-9 1.1.6 Remote Simulation Facility (RSF) . . . . . . . . . . . . . . . . . 1-15 1.2 Running ANSYS FLUENT in Batch Mode . . . . ...

    基于Java-SpringBoot2.X-VUE-Antd-MyBatis-Shiro-的扶贫救助系统源代码-毕业设计

    这是一个基于SpringBoot2.X,VUE2.6,Antd1.7.2,MyBatisPlus,Java1.8 的一个...4. sh /sbin/startup.sh dev 前端安装方法 1. yarn install (安装node_moudle) 2. yarn start (启动) 3. yarn build:pro (构建生产包)

    windows版curl

    -r, --recursive recursive web-suck -- use with care!. -l, --level=NUMBER maximum recursion depth (0 to unlimit). --delete-after delete downloaded files. -k, --convert-links convert non-relative...

    apache-tomcat-9.0.31-windows-x64.zip

    Denomic Web Project 2&gt;选择tomcat的运行环境。 (Target Runtime) 3&gt;webContent中创建jsp文件。 在jsp中编写内容。jsp中的文本将会 在用户访问该jsp文件时输出给客户端。 4&gt;打包: 右键project -&gt; export...

    stm32标准例程库函数.zip_misc.h_startup_stm32 模板_stm32f10x v3.5.0_stm32标

    标准例程-V3.5库函数版本\实验0 Template工程模板\CORE\startup_stm32f10x_hd.s 标准例程-V3.5库函数版本\实验0 Template工程模板\HARDWARE\LED\led.c 标准例程-V3.5库函数版本\实验0 Template工程模板\HARDWARE\...

    FCK在线编辑器源码及部署项目引用示例

    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;servlet-name&gt;SimpleUploader&lt;/servlet-name&gt; &lt;servlet-class&gt; com.FCKeditor.uploader.SimpleUploaderServlet &lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;...

    简单spring MVC 配置

    适合初学者的文档,&lt;web-app&gt; ... &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;test&lt;/servlet-name&gt; &lt;url-pattern&gt;*.do&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;/web-app&gt;

    4、Eclipse的安装配置

    -startup plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810 -product org.eclipse.epp.package.jee....

    EurekaLog_7.5.0.0_Enterprise

    8)....Fixed: Removed some unnecessary file system access on startup 9)....Fixed: Possible wrong font size in EurekaLog tools 10)..Fixed: Ignore timeouts from Shell_NotifyIcon 11)..Fixed: Possible ...

    spring mvc

    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;account&lt;/servlet-name&gt; &lt;url-pattern&gt;*.do&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; 要与web-inf里面account-servlet.xml名字对应、要...

    zk 配置的web.xml

    &lt;description&gt;ZK loader for ZUML pages &lt;servlet-name&gt;zkLoader&lt;/servlet-name&gt; ... &lt;!-- 必须指定更新引擎(DHtmlUpdateServlet)的URI,并且... &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;&lt;!-- Must --&gt; &lt;/servlet&gt;

    Spring MVC Demo

    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;!-- 配置所有以.do结尾的请求交给DispatcherServlet进行处理,也可以设置其他值,如.action等 --&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Dispatcher&lt;/servlet-name&gt; ...

    spring MVC 配置文档

    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; 加载 DispatcherServlet 时 Spring 会尝试读取配置文件 默认的配置文件位于 web.xml 相同的路径下 文件名与注册的 Servlet 名有关 Servlet注册名跟上 -...

    基于java的企业级应用开发:Spring MVC的核心类和注解.ppt

    * * * * Spring MVC的核心类和...&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;classpath:springmvc-config.xml&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;se

    BURNINTEST--硬件检测工具

    - A hang on startup has been corrected. A 2 minute timeout has been added to the collection of system information. - Video playback, Hard disk and CD/DVD test 'no operations' error reporting ...

    tomcat-juli.jar,tomcat-juli-adapters.jar,log4j-1.2.17.jar tomcat 8日志输出

    {"time":"2017-09-06 10:24:48,356","logtype":"INFO","loginfo":"org.apache.catalina.startup.HostConfig:Deploying web application directory C:\Users\admin\Desktop\Tomcat8\webapps\docs"} {"time":"2017-09-...

Global site tag (gtag.js) - Google Analytics