What is Single Threaded Model in Servlets? Explain this
with an example?
Answer Posted / m.rajkumar
The servlet programmer should implement SingleThreadModel interface to ensure that servlet can handle only one request at a time. It is a marker interface, means have no methods.
This interface is currently deprecated since Servlet API 2.4 because it doesn't solves all the thread-safety issues such as static variable and session attributes can be accessed by multiple threads at the same time even if we have implemented the SingleThreadModel interface. So it is recommended to use other means to resolve these thread safety issues such as synchronized block etc.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is servlet thread safe?
How do we translate jsp?
Explain the methods of request dispatcher in servlet?
The code in a finally clause will never fail to execute, right?
What is Servlet API used for connecting database?
Which exception is thrown if the servlet is not initialized properly?
Does servlet have main method?
What is the use of httpservletrequestwrapper?
What's the difference between servlets and applets?
How can we perform any action at the time of deploying the project?
What are the new features added to servlet 2.5?
What is the difference between Server and Container?
What is load-on-startup in servlet?
How do we go with database connection and log4j integration in servlet?
What do you mean by httpservlet and how it is different from the genericservlet?