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
Tell the new features added in servletrequest interface i.e. Servlet 2.4
How is a servlet implemented in code?
Write a simple servlet program to print the contents of html.
How can I send user authentication information while making URL Connection?
Explain the role of dispatcherservlet and contextloaderlistener.
Explain servlet events?
Is servlet a controller?
What is servlet collaboration?
What if we pass negative value in load-on-startup?
What are the steps that are required to handle the multi-threading?
What is a servlet?
What are life cycle methods of a servlet?
Difference between doget and dopost?
Why do we have servlet filters?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?