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
Servlet is pure java object or not?
What do you mean by annotations in servlet?
How do I use cookies to store session state on the client?
How can an existing session be invalidated?
What are the uses of servlets?
Which method of the httpservletrequest object is used?
What is servletconfig?
What are the various ways of session supervision in servlets?
What is the use of request dispatcher interface?
What is Servlets and explain the advantages of Servlet life cycle?
Which event is fired at the time of session creation and destroy?
How do we translate jsp?
What is the use of welcome-file-list?
What is cgi?
What are the advantages of cookies?