wood burning stoves*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Q about Servlets (4): when are servlets loaded? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Q about Servlets (4): when are servlets loaded?" Watch "Q about Servlets (4): when are servlets loaded?" New topic
Author

Q about Servlets (4): when are servlets loaded?

Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 977
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: 977
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: 977
Thanks Siva

Cheers,

Gian Franco
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Q about Servlets (4): when are servlets loaded?
 
Similar Threads
how do i solve this error caused due to problem in spring initiation on tomcat
Servlet replacement
init() and init(conf)
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class
[Urgent] How to configure Datasource externally