aspose file tools*
The moose likes Servlets and the fly likes Lifecycle of Servlet Context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Lifecycle of Servlet Context" Watch "Lifecycle of Servlet Context" New topic
Author

Lifecycle of Servlet Context

Hue Cheng
Greenhorn

Joined: Aug 15, 2003
Posts: 8
What is the lifecycle of a servlet context?
Would its lifetime be exactly the same as servlet?
I'm wondering when and how the methods
ContectInitialized and ContextDestroyed of
ServletContextListener will be called,
would anyone please explain them to me?
Thank you!
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
ServletContext get destroyed as soon as the Web Server shuts down..
hth
MB


Malhar Barai
SOA & Java Book
Hue Cheng
Greenhorn

Joined: Aug 15, 2003
Posts: 8
Thank you.
Then do you mean lifetime of a servlet context = lifetime of servlet?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12781
    
    5
I think the Servlet Context exists outside the lifetime of a servlet since there may be many servlets sharing a context in a single "web application." Read the JavaDocs for the javax.servlet.ServletContext interface for the authoritative information.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Lifecycle of Servlet Context