How to make servlet thread safe?
Answer Posted / shakir khan
There are situations where we want to protect your servlet
member variables from being modified by different
clients.In this case you can have your servlet by
implementing the marker interface SigleThreadModel.
Everytime a client makes request to a servlet by
implementing this interface,servlet engine will create a
new instance of servlet.
For performance reason,servlet engine can also maintain a
instance pool,handing out instances as they are needed.Or
it could also serialize client request executing one after
another.
| Is This Answer Correct ? | 49 Yes | 9 No |
Post New Answer View All Answers
What is the difference between Server and Container?
What do you mean by httpservlet?
When a servlet accepts a call from a client, it receives two objects. What are they?
How can we implement a jsp page?
How httpservlet is different from the genericservlet?
What do you mean by url pattern in servlet?
What is the use of servlet context?
why we should override only no-agrs init() method.
What do you mean by session tracking?
How the servlet is loaded?
What is api in servlet?
Difference between java beans & servlets?
Difference between forward() method and sendredirect() method ?
What are different methods of session management in servlets?
Define the life cycle of a servlets.