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 the
Write a hello world program using servlets.
What is the advantage of Servlets when compared with other server side technologies?
Can we get PrintWriter and ServletOutputStream both in a servlet?
When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?
What are the drawbacks of cgi?
What is the difference in between the httpservlet and generic servlet?
What are the difference between session and cookies in servlet? Explain
If my browser does not support cookie, and my server sends a cookie instance what will happen?
What is a web application and what is it’s directory structure?
Why servlet is mostly used?
Explain mvc pattern.
How is the get () method different from the post() method?
How do you invoke a servelt?
How printwriter is different from servletoutputstream?