For me, there is no correct answer. Is there only one instace of a servlet with different thread for each request? no matter whether the servlet is SingleThreadModel or not.
Can anyone tell me why A and D are correct please?
Any help is very appreciated!!
posted 11 years ago
For each incoming request container creates a seperate thread to handle the request. For example 10 users access the same servlet resource then 10 threads will be created by the container but there will be only one instance of that servlet.
Whereas when your servlet implements SingleThreadModel no more than one thread can access your servlet. It's just lik synchronizing your service method. So the container creates sepeate instance for every incoming request. with SingleThreadModel concurrency(multiple threads accessing the same resource) is severely affected. So it is appreciable NOT to use SingleThreadModel. Thats the reason why they had deprecated it from servlet spec 2.4