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
Whats the advantages using servlets over using CGI?
How do you design microservices?
What are the phases of the servlet life cycle?
Does servlet have main method?
What do you mean by cgi in servlet?
Name the different ways of session tracking.
What is the difference between forward () and sendredirect () functions in servlet? Explain
Difference between get and post in java servlets?
What is webservlet?
What are the life cycle methods of a servlet?
Explain the difference between a web server and a web container?
Write a servlet to upload file on server.
How do you run a servlet?
What is the servletconfig object?
How do cookies work in servlets?