论坛首页 Java企业应用论坛

web.xml中的load-on-startup

浏览 4306 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2010-12-17   最后修改:2010-12-17
来自于译文资料
load-on-startup定义了servlet启动的顺序。如果是负数或未出现。如
<load-on-startup>-3</load-on-startup>则容器自由决定什么时加载,通常是请求servlet
到达时加载。
如果是正数或0,则部署的项目启动时就加载,加载顺序为数小的先加载。
加载的含义(实例化servlet并执行该servlet的init()方法。)
   发表时间:2010-12-17  
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.
0 请登录后投票
   发表时间:2010-12-17  
规范里面的约定!
0 请登录后投票
   发表时间:2010-12-20  

这个我们关心的好像不是太多,只是在有的项目当中,还是需要注意这个的

0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics