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
What are the differences between servlet context vs servlet config?
What’s the difference between genericservlet and httpservlet?
What is called servlet container?
What do you mean by session tracking and also explain its techniques?
The code in a finally clause will never fail to execute, right?
What is meant by servlet? What are the parameters of the service method?
how many jsp scripting elements are there and what are those?
How can we refresh automatically when new data is entered into the database?
What are the steps that are involved in using the httpservlet class?
How to generate the server side programming and the advantages of it over the other languages?
Which application server is best for java?
Difference between doget and dopost?
How can the session in servlet be destroyed?
What do you mean by cgi in servlet?
Why is servlet used?