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
Explain the differences between jsp and servlet.
Why do we have servlet listeners?
Explain the difference between servlet and cgi?
How do you run a servlet?
What are the important functions of filters?
Can we use threads in Servlets?
Define context initialization parameters.
What is the use of java servlet api?
When servlet is loaded?
What are the differences between forward() method and sendredirect() methods?
What is the use of request dispatcher interface?
How can the session in servlet be destroyed?
What is the disadvantage of cookies?
What is servlet collaboration?
Write a program to show the functionality of doget and dopost method?