[Solved] why apache servlet is singleton? [duplicate]


Its an issue and it is never advisable to declare HttpServletRequest request/HttpServletResponse response as an instance variable. Actually Servlet is implementing single thread model that means only one servlet instance is created. And one thread for each request. So if their are many requests then thr must be many threads and each sharing same servlet instance inturn it will create data mismatch or data inconsistency problem. Threads will work on the same instances.

3

solved why apache servlet is singleton? [duplicate]