Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3632910
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:35:08+00:00 2026-05-19T00:35:08+00:00

I know what ServletContextListener is and how to implement/register it in web.xml. But the

  • 0

I know what ServletContextListener is and how to implement/register it in web.xml.

But the question is the following. At the start of web application single instance of listener per javaVM is created. Then its contextInitialized() method is called.

At the moment when application is being closed, contextDestroyed() method of listener is called. But is it the same instance of listener? Or that first instance could be destroyed and new one created for contextDestroyed() call?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T00:35:08+00:00Added an answer on May 19, 2026 at 12:35 am

    Definitive proof would have to come from the Servlet spec. I’m not sure that it provides an explicit answer to your question, but it does provide a strong hint:

    SRV.10.3.3 Listener Registration
    The Web container creates an instance of
    each listener class and registers it
    for event notifications prior to the
    processing of the first request by the
    application.

    Which implies that creating instances after processing the first request is prohibited.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As far as I know I can access the web.xml <context-param> s by making
I know this is a stupid question, but I can't find the answer anywhere.
I know this might be a no-brainer, but please read on. I also know
I know, I would have thought the answer was obviously no as well, but
I know there is a registry key indicating the install directory, but I don't
I know I must be missing something, but in a while statement how does
know nothing about php, but I have this script that reads a folder and
Know this might be rather basic, but I been trying to figure out how
I know similar questions have been posted before, but I have specific requirements that
I know that might sound like a stupid question since it's a trivial feature

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.