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 advantages of servlets over traditional cgi?
What do you mean by web applications?
Is tomcat a servlet container?
What are the common methods that are included in the http servlet class?
What is servlet collaboration?
What is a servlet engine?
What is servlet and how it works?
What is the need of servlet filters?
What is cookies in servlet with example?
Why is Servlet so popular?
What is the requirement of servlet config and servlet context implemented and how are they implemented?
Why do we have servlet listeners?
What is a web container and what is its responsibility?
When servlet is loaded?
What are the different types of servlets?