What is Single Threaded Model in Servlets? Explain this
with an example?
Answer Posted / devarathnam
Hi... Actually "SingleThreadedModel" is a marker
interface,which doesnot contain any methods.By default
servlet is multithreaded.If u want to make this as single
theaded u can implement this interface in the following
fashion.
public class SingleThreadedTest implements SingleThreadModel
{
//some code
//....
//....
//....
}It is Thread-safety mechanism on a shared resource.
Is This Answer Correct ? | 28 Yes | 7 No |
Post New Answer View All Answers
What is httpservlet class?
Explain the servlet filter.
Explain jsessionid and when is it created?
What do you mean by httpservlet?
What is a web container and what is its responsibility?
Why jsp is better than servlet?
Describe the phases of servlet lifecycle?
Is java servlet still used?
What do you mean by scope object and what are its types?
Why is http protocol called as a stateless protocol?
What is Request Dispatcher?
What’s the difference between genericservlet and httpservlet?
What exactly are the functions of servlet?
What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?
Given the request path below, which are context path, servlet path and path info?