Can anyone help me understanding SingleThreadModel , I know it ensures that servlet handle only one request at a time and guarantees that no two threads will execute concurrently in the servlet's service method, but what will be the situation where we should use SingleThreadModel, I mean we can use plain java class using webservice.
In what situation it will be helpful and beneficial to use servlet with SingleThreadModel.
Author and all-around good cowpoke
Joined: Mar 22, 2000
Short answer - NEVER
The original Servlet API included SingleThreadModel because web servers were a relatively new technology for Java developers and the designers thought that having STM might help people get started. As people have come to understand the web server environment they have realized that STM is not necessary and just causes complications.
Similar thinking brought us the "Invoker" servlet which has caused so much trouble.