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
Whether thread can be used in servlets?
What is preinitialization of a servlet?
How can the session in servlet be destroyed?
Can we use threads in Servlets?
How can we perform any action at the time of deploying the project?
Explain jsessionid and when is it created?
What is the capacity the doget can send to the server?
What are the new features added to servlet 2.5?
What is servlet and how it works?
What are the functions of the servlet container?
How do you create a cookie using servlet?
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?
What is servlet and its advantages?
Explain the war file?
Servlet is pure java object or not?