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
How can the session in servlet can be destroyed?
How can you push data from an Applet to a Servlet?
Which HTTP method is non-idempotent?
Describe the phases of servlet lifecycle?
The code in a finally clause will never fail to execute, right?
What are the uses of servlet and what is servlet chaining?
What are the type of protocols used in httpservlet?
What is api in servlet?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
How to find whether a parameter exists in the request object?
Which exception is thrown if the servlet is not initialized properly?
What is the difference between sendredirect() and forward() in a servlet?
How to make sure a servlet is loaded at the application startup?
Write a program to show the functionality of servlets.
Why session tracking is needed?