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
When Servlet is unloaded?
What is difference between GenericServlet and HttpServlet?
How does tomcat servlet container work?
What is difference between PrintWriter and ServletOutputStream?
What exception should be thrown when servlet is not properly initialized?
Why are servlets used?
What is servlet and its advantages?
How is an application exception handling is done using a servlet?
why we should override only no-agrs init() method.
What are some advantages of storing session state in cookies?
Explain the difference between servlet and cgi?
Why session tracking is needed?
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 that servlet is pure java object or not?
What is difference between get and post method?