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 do you mean by interservlet communication?

1013


What is servlet initializer?

915


What do you mean by web applications?

1118


Is it good idea to create servlet constructor?

1206


Is servlet synchronized?

1019


What are different ways for servlet authentication?

1045


What do you mean by cgi?

917


Can you refresh servlet in client and server-side automatically?

1029


When servlet object is created?

1073


What is the use of attribute in servlets?

1003


What is the difference between forward () and sendredirect () functions in servlet? Explain

980


Differentiate between get and post?

1102


Explain their methods? Tell me their parameter names also have you used threads in servlet?

988


What is a servlet context object?

1093


What is the use of servlet wrapper classes?

1121