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
Which java application server is the best?
When Servlet is unloaded?
Why do we have servlet filters?
What is meant by a web application
What is the difference between Servlets and Applets?
What is servlet interface?
Can we override servlet service method?
Define servlet mapping?
What exception should be thrown when servlet is not properly initialized?
Define declaration.
How do you configure a centralized error handler in servlets?
What is the importance of init() method in Servlet ?
What is the procedure of invoking different servlet in a different application?
Can you explain in detail 'javax.servlet' package?
Explain the role of dispatcherservlet and contextloaderlistener.