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
How to handle exceptions thrown by application with another servlet?
What is the default http method in the servlet?
When a servlet accepts a call from a client, it receives two objects. What are they?
What are the common methods that are included in the http servlet class?
Does servlet have main method?
Difference between get and post in java servlets?
Explain the features are in servlet 3?
What is servlet collaboration?
Explain session tracking and its importance?
What is httpservlet and how it is different from genericservlet?
What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
How the JSP file will be executed on the Server side?
What are different ways for servlet authentication?
What do you mean by chaining in servlet?
What is preinitialization of a servlet?