Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to make servlet thread safe?

Answer Posted / bhaskar padala

The servlet programmer should implement SingleThreadModel interface to ensure that servlet can handle only one request at a time. It is a marker interface, means have no methods.


This interface is currently deprecated since Servlet API 2.4 because it doesn't solves all the thread-safety issues such as static variable and session attributes can be accessed by multiple threads at the same time even if we have implemented the SingleThreadModel interface. So it is recommended to use other means to resolve these thread safety issues such as synchronized block etc.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What must be implemented by all servlets?

1053


How do you communicate in between Applets and Servlets?

1028


What are the different session tracking techniques?

1152


What is a servlet engine?

975


When Servlet is unloaded?

1056


How do you load an image in a Servlet?

1130


Explain Action Servlet?

1037


Is servlet synchronized?

1027


What are the jobs performed by servlets?

1015


Whether we can get deadlock situation in servlets?

1019


How can a servlet be used to generate plain text instead of html?

912


What is the difference between servlet and filter?

921


What is a generic servlet?

909


What is the workflow of a servlet?

1132


Can servlet have a constructor ?

1005