• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Lifecycle of Servlet Context  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext get destroyed as soon as the Web Server shuts down..
hth
MB
 
Hue Cheng
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
Then do you mean lifetime of a servlet context = lifetime of servlet?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Whatever you say buddy! And I believe this tiny ad too:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!