• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet load-on-startup doubt

 
lalit upadheyay
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have some confusion between the errata and HFSNJ regarding thios topic.

on page 596 (end of 3rd para)
"If you have two or more servlets with the same value, the container loads them in the order in which the servlets are defined in the DD"

In BANG Box on page 596
" The container loads servlets with the same value in the order in which the servlets are declared in the DD".

But the errata ammends paragraph 3rd as "The container may choose the order in which this subset initialized".

The errata says nothing about the BANG box. So this creates conflict between the errata and BANG box.

Will someone experienced enough clarify the view? (No guess work please)

Regards,
Lalit
 
sunil chow
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lalit

Check the below paragraph from the servlet 2.4 spec

---------------------------------------------------------------------

The element load-on-startup indicates that this servlet should be loaded (instantiated and have its init() called) on the startup of the Web application. The element content of this 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-startup value.

---------------------------------------------------------------------

Hope u r clear now

Regards
-------
If you aren't making mistakes,
you aren't trying hard enough
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic