Consider a scenario in which 4 user are accessing a servlet instance.among which one user called destroy() method.what happens to the rest 3 users?
2 Answers
Each Servlet when accessed by a user creates a session of their own. When you call destroy(); only your session/Servlet life-cycle is effected.
Additional resources for reading:
How do servlets work? Instantiation, sessions, shared variables and multithreading
http://www.tutorialspoint.com/servlets/servlets_overview.htm
We know that by default servlet is multithreaded, for every client request a new thread will be created and assigned to that to perform the service. so if one thread initiates destroy() only itself will be terminated but other threads not terminates.
Other wise, it is against to servlet spec. regarding multithreading concept. ex: suppose if u open 2 browser instances for a website, if u move from one site to another in one browser the other remains connect to same site not terminates.