How do servlets work-Instantiation, sessions, shared variables and multithreading[reproduced]
Whentheservletcontainer(like ApacheTomcat)startsup,itwilldeployandloadallwebapplications.Whenawebapplicationgetloaded,theservletcontainerwillcreatethe ServletContext onceandkeepinserver'smemory.Theweb