How to make servlet thread safe?
Answer Posted / tulasi vani
There are two different ways of making a servlet thread
safe namely
1.By implementing SingleThreadModel.
By implementing a SingleThreadModel it will be possible to
create a Thread safe servlet.There can only be one user at
a given point of time.
2.Synchornize the part of sensitive code.
We can allow a single user at a given point of time by
making that part of the code which is sensitive as
synchronized.
| Is This Answer Correct ? | 127 Yes | 6 No |
Post New Answer View All Answers
When Servlet is unloaded?
What exactly is a servlet?
What are the steps that are required to handle the multi-threading?
What are the difference between RMI and Servlets?
What is servlet configuration?
What is the difference between servlet and jsp?
What are the phases of servlet life cycle?
What are the functions of the servlet container?
How to notify an object in session when session is invalidated or timed-out?
What is the difference between the http servlet and generic servlet?
What are the types of servlet?
What is the workflow of a servlet?
Can we override destroy method in servlet?
What is a generic servlet?
What are the various ways of session supervision in servlets?