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
When should you prefer to use doget() over dopost()?
What is java servlet session?
Difference between doget and dopost?
How we can create war file in servlet?
What are the advantages of Servlet over CGI?
Which HTTP method is non-idempotent?
What do you mean by interservlet communication?
How can a servlet be used to generate plain text instead of html?
hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code
Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?
Is servlet a controller?
What is http servlet?
Explain jsessionid and when is it created?
Why is a constructor needed in a servlet even if we use the init method?
How can you run a servlet program?