| Author |
Q about Servlets (4): when are servlets loaded?
|
Gian Franco
blacksmith
Ranch Hand
Joined: Dec 16, 2003
Posts: 975
|
|
Hi, In how many occasions will a servlet be loaded: when the web server starts after the container detects its class file has chaged when the user sends a request Are all these options valid? I think it depends on the container. For example, I think WebSphere doesn't allow changes to the class file if the web-application has been started. Cheers, Gian Franco
|
"Eppur si muove!"
|
 |
Phani Kumar Sripada
Greenhorn
Joined: Aug 14, 2003
Posts: 5
|
|
Hi Gian, It also depends on how you write you Deployment Descriptor. If you specify "load-on-startup" element for a partical servlet in the DD then the servlet will be loaded as per the value that is assigned to this element. In case if this element is missing in the web.xml then loading of Servlet will be determined by the container. It can happen at the time of container startup or can be delayed until the container determines the servlet is needed to service a request. This implimentaion varies from one container to the other. Phani.
|
SCJP 1.4
|
 |
Gian Franco
blacksmith
Ranch Hand
Joined: Dec 16, 2003
Posts: 975
|
|
Thanks Phani, Do you by any chance know whether such details can be part of the exam? Cheers, Gian Franco
|
 |
Sivasundaram Umapathy
Ranch Hand
Joined: Aug 10, 2002
Posts: 360
|
|
|
It's better to understand the servlet life cycle and the tasks that are carried out during servlet initialisation. Also the knowledge of load-on-startup element is essential.
|
Siva
Co-Author - SCMAD Exam Guide - ISBN:9780070077881
Author - Java certification success, Part 4: SCEA
|
 |
Gian Franco
blacksmith
Ranch Hand
Joined: Dec 16, 2003
Posts: 975
|
|
Thanks Siva Cheers, Gian Franco
|
 |
 |
|
|
subject: Q about Servlets (4): when are servlets loaded?
|
|
|