This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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!
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