• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

load-on-startup

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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. If the value is a positive 128 integer or 0, the container must load and
initialize the servlet as the application is deployed.

If +ve integer or 0 then the load the servlet after the container startsup.

From HFServlets & JSP 1 st edition : Page 596 [3rd para] : In other words any value greater than zero means load early.

Who is correct?
I tested and found a zero value of <load-on-startup> causes the early load of the servlet [ or JSP generated servlet i.e, init() or jspInit() is invoked]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Who is correct?


The specification is correct. And it says :
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.
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it is -ve or value is not there means container should load when ever request for the servlet. The value may be 0 or pisitive ( between
0 to 128). Always lower values will choose first and if you have same value , then order matters in DD means first(earlier) will be choosen.



Thanks
Praveen
SCWCD Preparing
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HFS requires a errata if its not there already.
reply
    Bookmark Topic Watch Topic
  • New Topic