How to make servlet thread safe?
Answer Posted / sanjay
to make servlet as threas safe we have three approaches
1.do not instance variables into our servlet we use only
local variables
2.by using synchronized methods
3.synchronized blocks
above three ways synchronized blocks is the best way
| Is This Answer Correct ? | 12 Yes | 1 No |
Post New Answer View All Answers
What are the supporting protocol by HttpServlet ?
How we can get ip address of client in servlet?
What’s the difference between genericservlet and httpservlet?
How the JSP file will be executed on the Server side?
What is servlet collaboration?
Why is http protocol called as a stateless protocol?
What do you mean by filter in servlet?
What are the uses of servlet
What is the GenericServlet class?
Where do you define dispatcherservlet?
What are the different ways we can maintain state between requests?
Explain the differences between jsp and servlet.
How a servlet is unloaded?
Explain jsessionid?
List out the difference between ServletConfig and ServletContext?